aarch64 compiler creates invalid code for implicit int64 to byte cast with -O1 and {$Q+}
Original Reporter info from Mantis: djenkins @dfjenkins
-
Reporter name: David Jenkins
Original Reporter info from Mantis: djenkins @dfjenkins
- Reporter name: David Jenkins
Description:
The implicit cast in the following line:
bob := LBitSize and $FF
where bob is Byte and LBitSize is Int64
Results in:
Assembling (pipe) ByteCompileError.s
&LtPos;stdin>:11:7: error: invalid operand for instruction
strb x0,[sp, #16]
When compile with -O1 and {Q+}
Steps to reproduce:
program ByteCompilerError;
{$Q+}
function NativeGetHashBytes: Byte;
var
LBitSize: Int64;
bob: byte;
begin
bob := LBitSize and $FF;
end;
begin
end.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Compile above code with:
/usr/local/bin/ppca64 -O1 ByteCompileError.pas
Mantis conversion info:
- Mantis ID: 37427
- OS: MacOS
- OS Build: Big Sur
- Platform: MacOS arm64 DTK
- Version: 3.2.0
- Fixed in version: 3.3.1
- Fixed in revision: 45872 (#0b5c50ea)
- Monitored by: » IgorKokarev (Igor Kokarev)