I'm wondering if this is related to https://gitlab.com/freepascal.org/fpc/source/-/issues/38703 That caused a parameter corruption in a standard function. https://lists.freepascal.org/pipermail/fpc-pascal/2022-March/060361.html Should be easy to check. Just try compiling with -O1 Cheers, Peter