Explorar el Código

* do not optimize away +0.0 if no fastmath is passed as -0.0+(+0.0)=+0.0

florian hace 3 años
padre
commit
95dfccbb5e
Se han modificado 1 ficheros con 6 adiciones y 2 borrados
  1. 6 2
      compiler/nadd.pas

+ 6 - 2
compiler/nadd.pas

@@ -1062,8 +1062,12 @@ implementation
                         case nodetype of
                           addn:
                             begin
-                              result:=right.getcopy;
-                              exit;
+                              { -0.0+(+0.0)=+0.0 so we cannot carry out this optimization if no fastmath is passed }
+                              if not(cs_opt_fastmath in current_settings.optimizerswitches) then
+                                begin
+                                  result:=right.getcopy;
+                                  exit;
+                                end;
                             end;
                           slashn,
                           muln: