Inline produces incorrect code which causes app to crash
Original Reporter info from Mantis: Xor-el
-
Reporter name: Ugochukwu Mmaduekwe
Original Reporter info from Mantis: Xor-el
- Reporter name: Ugochukwu Mmaduekwe
Description:
I discovered the bug when I tried compiling and running my CryptoLib4Pascal UnitTests with FPC Trunk version 3.3.1-r43642 for x86_64. In my case, it caused random access violations.
When certain methods are inlined, the compiler tends to produce incorrect code which tends to crash when run.
Steps to reproduce:
To reproduce the crash, compile the demo project attached (InliningBug.lpr) with the affected FPC version (FPC Trunk version 3.3.1-r43642 for x86_64) making sure Inlining is enabled.
Disabling optimizations does not seem to resolve the issue in my case.
the only workaround is disabling Inlining using {$INLINE OFF}
Mantis conversion info:
- Mantis ID: 36402
- OS: Windows 10
- OS Build: 1903
- Build: r43642
- Platform: x86_64
- Version: 3.3.1
- Monitored by: » Xor-el (Ugochukwu Mmaduekwe), » @CuriousKit (J. Gareth Moreton)