-CpCOREAVX2 is scared of -OoFASTMATH
Original Reporter info from Mantis: runewalsh
-
Reporter name:
Original Reporter info from Mantis: runewalsh
- Reporter name:
Description:
The given code writes 3.100 instead of correct 1.300 when all of these conditions are met:
— i386[-win32] target
— -CfAVX -CpCOREAVX2 -OoFASTMATH
In particular, results are correct given any of the following:
— x86_64 target
— -CpCOREAVX instead of -CpCOREAVX2
— -O4 -OoNOFASTMATH
Steps to reproduce:
var
a, b: uint32; // or (u)int64; int32 works
r: single; // or double, or even extended
begin
a := 1;
b := 3;
r := a + b / 10;
writeln(r:0:3);
end.
Mantis conversion info:
- Mantis ID: 38295
- Build: FPC 3.3.1-r47986 [2021/01/03]
- Platform: i386-win32
- Fixed in version: 3.3.1
- Fixed in revision: 48017 (#9592c033)