[fpc-pascal] Arguments gets corrupted with anonymous nested function

Jonas Maebe jonas at freepascal.org
Wed Sep 7 20:35:30 CEST 2022


On 2022-09-07 17:09, Benito van der Zander via fpc-pascal wrote:

> Hi,
> 
>> https://gitlab.com/freepascal.org/fpc/source/-/issues/38703
> 
>> I'm afraid that with -O4 it is by design.
>> -O4 enables -OoUNCERTAIN, and the documentation about -OoUNCERTAIN 
>> notes that:
>> 
>> "If uncertain optimizations are enabled, the CSE algorithm assumes 
>> that
>> -- If something is written to a local/global register or a 
>> procedure/function parameter, this value doesn't overwrite the value 
>> to which a pointer points.
>> -- If something is written to memory pointed to by a pointer variable, 
>> this value doesn't overwrite the value of a local/global variable or a 
>> procedure/function parameter."
> 
> is it doing that? did it ever do that?

It did that when the old assembler-level CSE optimiser still existed. 
It's been removed for a long time now.


Jonas


More information about the fpc-pascal mailing list