소스 검색

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

florian 3 년 전
부모
커밋
95dfccbb5e
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  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: