smallint aarch64 codegen trouble with -O2 option
Summary
Basic test from testsuite test/units/system/tincdec.pp
fails for aarch64 CPU target when -O2
option (or higher) is used.
System Information
- Operating system: Any
- Processor architecture: aarch64
- Compiler version: trunk 3.3.1
- Device: Any
Steps to reproduce
Recompile test/units/system/tincdec.pp
with trunk aarch64 compiler and option -O2
Example Project
What is the current bug behavior?
Test fails with run time error 2, which indicates a problem with 16-bit signed integers code.
What is the expected (correct) behavior?
The test should succeed.
seems to show that this test fails since Marc 20. 2022
Relevant logs and/or screenshots
It seems that the 16-bit value gets loaded into a 32-bit register, but the value is not correctly sign extended to 32-bit.
Possible fixes
Add instruction to do the sign extension to 32-bit.