View Issue Details

IDProjectCategoryView StatusLast Update
0038249FPCCompilerpublic2020-12-23 23:42
ReporterC Western Assigned ToFlorian  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64 
Product Version3.3.1 
Fixed in Version3.3.1 
Summary0038249: Bad code generation under -O4
Descriptionvar
  A: Double = 0.0001;
  B: Double = 0;
begin
  if B >= 0 then
    A := B;
  WriteLn(A); { Writes 1e-4 under -O4, should be 0 }
end.
                                    
Steps To Reproduce$ fpc t.pas
Free Pascal Compiler version 3.3.1 [2020/12/23] for x86_64
Copyright (c) 1993-2020 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling t.pas
Linking t
11 lines compiled, 0.1 sec, 147216 bytes code, 56680 bytes data
$ ./t
 0.0000000000000000E+000
$ fpc -O4 t.pas
Free Pascal Compiler version 3.3.1 [2020/12/23] for x86_64
Copyright (c) 1993-2020 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling t.pas
Linking t
11 lines compiled, 0.1 sec, 147200 bytes code, 56680 bytes data
$ ./t
 1.0000000000000000E-004
Additional InformationSame result under linux and Windows
TagsNo tags attached.
Fixed in Revision47843
FPCOldBugId
FPCTarget-
Attached Files

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2020-12-23 13:13 C Western New Issue
2020-12-23 23:42 Florian Assigned To => Florian
2020-12-23 23:42 Florian Status new => resolved
2020-12-23 23:42 Florian Resolution open => fixed
2020-12-23 23:42 Florian Fixed in Version => 3.3.1
2020-12-23 23:42 Florian Fixed in Revision => 47843
2020-12-23 23:42 Florian FPCTarget => -