View Issue Details

IDProjectCategoryView StatusLast Update
0033607FPCCompilerpublic2019-01-01 16:50
Reporterpunit Assigned ToJonas Maebe  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformarm64OSDebian Linux 
Product Version3.0.4 
Target Version3.2.0Fixed in Version3.2.0 
Summary0033607: arm64: Incorrect record member value when returned from a function
DescriptionWhile investigating build failure reported in debian bug[0] I've stumbled
upon what seems like a free pascal compiler issue on arm64.

[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891682

The value of a member of a record returned by a function varies depending on usage.

The observed value of

   S.Width where S := R.ScaleAround0(2)

differs from the value of

   R.ScaleAround0(2).Width

The values differ on arm64 but agree on x86-64.

The attached reproducer gives the following output on arm64 -

    arm64:~/src/fpc-test$ ./test
    S.Width=0 R.ScaleAround0(2).Width=214748364800

while on x86-64

    x86-64$ ./test
    S.Width=0 R.ScaleAround0(2).Width=0
    
The reproducer is derived from a failing test in Castle Game Engine.
Steps To ReproduceRun the attached test.pas on arm64 and x86 machine.
TagsNo tags attached.
Fixed in Revision40512,40735
FPCOldBugId
FPCTarget
Attached Files

Activities

punit

2018-04-14 18:49

reporter  

test.pas (931 bytes)

Thaddy de Koning

2018-04-14 20:30

reporter   ~0107791

Last edited: 2018-04-14 20:35

View 5 revisions

I tested this for AARCH64 and when integer is changed to NativeInt it has the correct result.
Can it be that AARCH64 maintainer needs a look at the integer type? I see there are multiple exceptions about a 32 bit size. But NativeInt works.

Issue History

Date Modified Username Field Change
2018-04-14 18:49 punit New Issue
2018-04-14 18:49 punit File Added: test.pas
2018-04-14 20:30 Thaddy de Koning Note Added: 0107791
2018-04-14 20:30 Thaddy de Koning Note Edited: 0107791 View Revisions
2018-04-14 20:34 Thaddy de Koning Note Edited: 0107791 View Revisions
2018-04-14 20:34 Thaddy de Koning Note Edited: 0107791 View Revisions
2018-04-14 20:35 Thaddy de Koning Note Edited: 0107791 View Revisions
2018-12-09 14:47 Jonas Maebe Fixed in Revision => 40512
2018-12-09 14:47 Jonas Maebe Status new => resolved
2018-12-09 14:47 Jonas Maebe Fixed in Version => 3.3.1
2018-12-09 14:47 Jonas Maebe Resolution open => fixed
2018-12-09 14:47 Jonas Maebe Assigned To => Jonas Maebe
2018-12-09 14:47 Jonas Maebe Target Version => 3.2.0
2019-01-01 16:50 Jonas Maebe Fixed in Revision 40512 => 40512,40735
2019-01-01 16:50 Jonas Maebe Fixed in Version 3.3.1 => 3.2.0