Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2026-02

Possible inlining problem

2 messages · 1 person · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

J. Gareth Moreton

Hi everyone,

So I recently rebased my pure function code
(https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/645 - nearly 2 years since I first made the merge request, on top of 2 years of initial development!) and it now gets stuck in an infinite loop.  I hadn't made any recent changes, so this was a little bit alarming.  In gitlab, the following line is generated ad infinitum:

|variant.inc(413,17) Note: Call to subroutine "operator :=(const
source:Variant):NativeInt;" marked as inline is not inlined|

Locally (x86_64-win64) it gets stuck at ppc1 compiling the system unit.  Using breakpoints, I found it gets stuck in the "first pass" stage when it tries to expand a function call. Since I'm not getting a stack error, I assume it's a vicious circle where one thing is changed to another, and then that new object is changed back to the original.

I'll work to try to see what's happening in the node tree, and if it's my code that's causing this or if it only uncovers the fault.  Bear in mind this issue only appeared when I recently rebased the merge request.

Not pointing fingers (it may actually be my fault!) but be on the lookout for any potential inlining issues.

Kit

This email has been checked for viruses by Avast antivirus software. www.avast.com

Reply by email

J. Gareth Moreton
to J. Gareth Moreton

So there is a problem!

https://gitlab.com/freepascal.org/fpc/source/-/issues/41616

It's possible to trigger an infinite loop in the compiler.

Kit

J. Gareth Moreton wrote 39 lines
Hi everyone, So I recently rebased my pure function code (https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/645 - nearly 2 years since I first made the merge request, on top of 2 years of initial development!) and it now gets stuck in an infinite loop.  I hadn't made any recent changes, so this was a little bit alarming.  In gitlab, the following line is generated ad infinitum: |variant.inc(413,17) Note: Call to subroutine "operator :=(const source:Variant):NativeInt;" marked as inline is not inlined| Locally (x86_64-win64) it gets stuck at ppc1 compiling the system unit.  Using breakpoints, I found it gets stuck in the "first pass" stage when it tries to expand a function call. Since I'm not getting a stack error, I assume it's a vicious circle where one thing is changed to another, and then that new object is changed back to the original. I'll work to try to see what's happening in the node tree, and if it's my code that's causing this or if it only uncovers the fault.  Bear in mind this issue only appeared when I recently rebased the merge request. Not pointing fingers (it may actually be my fault!) but be on the lookout for any potential inlining issues. Kit <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Virus-free.www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> _______________________________________________ fpc-devel maillist https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
This email has been checked for viruses by Avast antivirus software. www.avast.com

Reply by email