arm64: Incorrect record member value when returned from a function
Original Reporter info from Mantis: punit
-
Reporter name:
Original Reporter info from Mantis: punit
- Reporter name:
Description:
While investigating build failure reported in debian bug[0] I've stumbled
upon what seems like a free pascal compiler issue on arm64.
[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891682
The value of a member of a record returned by a function varies depending on usage.
The observed value of
S.Width where S := R.ScaleAround0(2)
differs from the value of
R.ScaleAround0(2).Width
The values differ on arm64 but agree on x86-64.
The attached reproducer gives the following output on arm64 -
arm64:~/src/fpc-test$ ./test
S.Width=0 R.ScaleAround0(2).Width=214748364800
while on x86-64
x86-64$ ./test
S.Width=0 R.ScaleAround0(2).Width=0
The reproducer is derived from a failing test in Castle Game Engine.
Steps to reproduce:
Run the attached test.pas on arm64 and x86 machine.
Mantis conversion info:
- Mantis ID: 33607
- OS: Debian Linux
- Platform: arm64
- Version: 3.0.4
- Fixed in version: 3.2.0
- Fixed in revision: 40512 (#52fec8a9),40735 (#fc9e9e80)
- Monitored by: » paul.gevers (Paul Gevers), » Vincent (Vincent Snijders), » @michaliskambi (Michalis Kamburelis)
- Target version: 3.2.0