View Issue Details

IDProjectCategoryView StatusLast Update
0037427FPCCompilerpublic2020-07-31 20:13
ReporterDavid Jenkins Assigned ToFlorian  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformMacOS arm64 DTKOSMacOS 
Product Version3.2.0 
Fixed in Version3.3.1 
Summary0037427: aarch64 compiler creates invalid code for implicit int64 to byte cast with -O1 and {$Q+}
DescriptionThe implicit cast in the following line:

bob := LBitSize and $FF

where bob is Byte and LBitSize is Int64

Results in:
Assembling (pipe) ByteCompileError.s
<stdin>:11:7: error: invalid operand for instruction
        strb x0,[sp, 0000016]

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
TagsNo tags attached.
Fixed in Revision45872
FPCOldBugId
FPCTarget-
Attached Files

Relationships

has duplicate 0037443 resolvedJonas Maebe Compilation problem for aarch64-darwin-cocoa 

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2020-07-27 23:20 David Jenkins New Issue
2020-07-28 22:46 Florian Assigned To => Florian
2020-07-28 22:46 Florian Status new => resolved
2020-07-28 22:46 Florian Resolution open => fixed
2020-07-28 22:46 Florian Fixed in Version => 3.3.1
2020-07-28 22:46 Florian Fixed in Revision => 45872
2020-07-28 22:46 Florian FPCTarget => -
2020-07-29 22:08 Dmitry Boyarintsev Relationship added related to 0037443
2020-07-31 20:13 Jonas Maebe Relationship replaced has duplicate 0037443