Optimalization -O2 error in Linux64
Original Reporter info from Mantis: Petr-K
-
Reporter name:
Original Reporter info from Mantis: Petr-K
- Reporter name:
Description:
OS: Linux x86_64
fpc: trunk revision 13182
rtl function MSecsToTimeStamp returns always result.Date = 0
After some experiments I found that this funcion:
function f: TTimeStamp;
var
i: Integer;
begin
Result.Date := 1;
Result.Time := 1;
writeln(Result.Date); //1
writeln(Result.Time); //1
i := 2;
Result.Time := Round(i); //With -O2 on Linux64 this operation destroys Result.Date
writeln(Result.Date); //0
writeln(Result.Time); //2
end;
Compiled with -O2 prints
1
1
0
2
Compiled without optimalization, works ok.
This problem occurs only in Linux64. With the same version of compiler on Linux32, Win32 and Win64 example and MSecsToTimeStamp works ok.
Mantis conversion info:
- Mantis ID: 13948
- OS: Linux
- Build: 13182
- Platform: x86_64
- Version: 2.3.1
- Fixed in version: 2.4.0
- Fixed in revision: 13255 (#5c4f80d6)