[fpc-devel] Possible inlining problem

J. Gareth Moreton gareth at moreton-family.com
Sat Feb 14 04:25:59 CET 2026


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


On 12/02/2026 16:25, J. Gareth Moreton via fpc-devel wrote:
>
> 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  -fpc-devel at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

-- 
This email has been checked for viruses by Avast antivirus software.
www.avast.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20260214/46b52f4c/attachment.htm>


More information about the fpc-devel mailing list