View Issue Details

IDProjectCategoryView StatusLast Update
0037393FPCCompilerpublic2020-07-21 12:05
ReporterChris Rorden Assigned ToFlorian  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformMacBook 2012 Retina 13"OSDarwin 
Product Version3.3.1 
Fixed in Version3.3.1 
Summary0037393: AArch64 functions with many arguments fail at higher optimization levels
DescriptionThis program runs nicely at low optimization levels, but drops values at optimization level 2 or higher:

% fpc -O1 fx.pas

Free Pascal Compiler version 3.3.1 [2020/07/18] for aarch64
Copyright (c) 1993-2020 by Florian Klaempfl and others
Target OS: Darwin for AArch64
Compiling fx.pas
Assembling (pipe) fx.s
Linking fx
13 lines compiled, 0.2 sec

% ./fx

 1.000000000E+00 2.000000000E+00 3.000000000E+00 4.000000000E+00
 5.000000000E+00 6.000000000E+00 7.000000000E+00 8.000000000E+00
 9.000000000E+00 1.000000000E+01 1.100000000E+01 1.200000000E+01

% fpc -O3 fx.pas

Free Pascal Compiler version 3.3.1 [2020/07/18] for aarch64
Copyright (c) 1993-2020 by Florian Klaempfl and others
Target OS: Darwin for AArch64
Compiling fx.pas
Assembling (pipe) fx.s
Linking fx
13 lines compiled, 0.2 sec

% ./fx
 1.000000000E+00 2.000000000E+00 3.000000000E+00 4.000000000E+00
 5.000000000E+00 6.000000000E+00 7.000000000E+00 8.000000000E+00
 0.000000000E+00 0.000000000E+00 0.000000000E+00 1.200000000E+01

Steps To ReproduceRun this program at optimization level 2 or higher

program fx;
procedure rep9(a,b,c,d, e,f,g,h, i,j,k,l: single);
begin
    writeln(a, ' ', b, ' ', c, ' ', d);
    writeln(e, ' ', f, ' ', g, ' ', h);
    writeln(i, ' ', j, ' ', k, ' ', l);
end;
begin
    rep9(1,2,3,4,5,6,7,8,9,10,11,12);
end.
TagsNo tags attached.
Fixed in Revision45814
FPCOldBugId
FPCTarget-
Attached Files

Activities

Florian

2020-07-20 23:08

administrator   ~0124195

As linux showed the same problem, I used linux for debugging and to test the fix.

Chris Rorden

2020-07-21 12:05

reporter   ~0124203

Thanks!

Issue History

Date Modified Username Field Change
2020-07-20 18:37 Chris Rorden New Issue
2020-07-20 23:08 Florian Assigned To => Florian
2020-07-20 23:08 Florian Status new => resolved
2020-07-20 23:08 Florian Resolution open => fixed
2020-07-20 23:08 Florian Fixed in Version => 3.3.1
2020-07-20 23:08 Florian Fixed in Revision => 45814
2020-07-20 23:08 Florian FPCTarget => -
2020-07-20 23:08 Florian Note Added: 0124195
2020-07-21 12:05 Chris Rorden Status resolved => closed
2020-07-21 12:05 Chris Rorden Note Added: 0124203