Optimization bug when building BGRABitmap on Darwin aarch64
Original Reporter info from Mantis: Wallaby
-
Reporter name:
Original Reporter info from Mantis: Wallaby
- Reporter name:
Description:
I have encountered this issue when building my application that uses BGRABitmap for Cocoa/AArch64.
When /O2 or /O3 is used, compilation for aarch64 fails with:
(9001) Assembling (pipe) bgrabitmaptypes.s
&LtPos;stdin>:2739:10: error: invalid operand for instruction
fadd d0,s0,s1
^
&LtPos;stdin>:2742:13: error: invalid operand for instruction
fadd d0,d0,s1
If I use /O1 the code compiles correctly. This only happens on Cocoa/AArch64, that is Cocoa/x86_64 compiles correctly with any optimization level.
Steps to reproduce:
-
Unpack the attached project to an empty directory on Mac OS 11. You will need Lazarus built for aarch64 or have a cross-compiler. In my case I use a cross-compiler on Mac OS 11 x86_64 to produce aarch64 binary.
-
Execute lazbuild -B --cpu=aarch64 --ws=cocoa project1.lpr
-
Observe compilation fails during assembling with the above errors.
Note the optimization level needs to be O2 or O3 in the project settings. It will compile fine with O1.
Mantis conversion info:
- Mantis ID: 39012
- OS Build: 11
- Build: trunk
- Platform: macOS
- Version: 3.3.1