FPC 2.7.1 | ARMHF/ARMV6 | Optimization breaks execution at -O2
Original Reporter info from Mantis: bruce
-
Reporter name: Bruce Tulloch
Original Reporter info from Mantis: bruce
- Reporter name: Bruce Tulloch
Description:
A variety of largish applications we have built crash when -O2 is used on this target but they all execute successfully at -O1. The same apps compile and run without any problems on 32 and 64 bit x86 targets under Linux and Windows at any optimization level.
Steps to reproduce:
The specific failure mode varies by application but in all cases it is provoked by using -O2. We have managed to capture one case were failure occurs at a predictable place (in an inherited method call) but only when called via a specific derived class (i.e. after being called successfully as an inherited method many other times from many other derived classes).
This function has been compiled at -O1 and -O2 and the -alnr assembly files are attached. We suspect both cases are logically correct but something is not right on the stack or in registers used for the final call before the SEGV occurs.
We don't think it's bad code in the called or calling method per se because other apps that suffer execution problems at -O2 do not use these classes at all; they fail in other ways which have not yet been able to isolate.
Our best guess is memory or stack corruption is occurring some time before the consequences of it are seen.
Additional information:
All these applications are multi-threaded.
Mantis conversion info:
- Mantis ID: 24492
- OS: Raspbian
- OS Build: 7.0
- Platform: Raspberry Pi
- Version: 2.7.1
- Fixed in version: 3.0.0
- Fixed in revision: 25777 (#5276159e)
- Monitored by: » bruce (Bruce Tulloch)