c-common.c (cb_register_builtins): Set __FINITE_MATH_ONLY__ to 1 if -ffinite-math...
authorToon Moene <toon@moene.indiv.nluug.nl>
Thu, 1 Aug 2002 09:08:38 +0000 (11:08 +0200)
committerToon Moene <toon@gcc.gnu.org>
Thu, 1 Aug 2002 09:08:38 +0000 (09:08 +0000)
2002-08-01  Toon Moene  <toon@moene.indiv.nluug.nl>

* c-common.c (cb_register_builtins): Set
__FINITE_MATH_ONLY__ to 1 if -ffinite-math-only
is given, and to 0 otherwise.
* combine.c (simplify_if_then_else): HONOR_NANS
implies FLOAT_MODE_P.

From-SVN: r55932

gcc/ChangeLog
gcc/c-common.c
gcc/combine.c

index 5487dfc..42d40c9 100644 (file)
@@ -1,3 +1,11 @@
+2002-08-01  Toon Moene  <toon@moene.indiv.nluug.nl>
+
+       * c-common.c (cb_register_builtins): Set
+       __FINITE_MATH_ONLY__ to 1 if -ffinite-math-only
+       is given, and to 0 otherwise.
+       * combine.c (simplify_if_then_else): HONOR_NANS
+       implies FLOAT_MODE_P.
+
 2002-08-01  Neil Booth  <neil@daikokuya.co.uk>
 
        * cppinit.c (COMMAND_LINE_OPTIONS): Remove OPT_dollar.
index 784cc64..b9df2e2 100644 (file)
@@ -4784,7 +4784,9 @@ cb_register_builtins (pfile)
   if (flag_signaling_nans)
     cpp_define (pfile, "__SUPPORT_SNAN__");
   if (flag_finite_math_only)
-    cpp_define (pfile, "__FINITE_MATH_ONLY__");
+    cpp_define (pfile, "__FINITE_MATH_ONLY__=1");
+  else
+    cpp_define (pfile, "__FINITE_MATH_ONLY__=0");
 
   if (flag_iso)
     cpp_define (pfile, "__STRICT_ANSI__");
index 297e6a4..236ac2e 100644 (file)
@@ -4775,12 +4775,12 @@ simplify_if_then_else (x)
 
   /* Convert a == b ? b : a to "a".  */
   if (true_code == EQ && ! side_effects_p (cond)
-      && (!FLOAT_MODE_P (mode) || !HONOR_NANS (mode))
+      && !HONOR_NANS (mode)
       && rtx_equal_p (XEXP (cond, 0), false_rtx)
       && rtx_equal_p (XEXP (cond, 1), true_rtx))
     return false_rtx;
   else if (true_code == NE && ! side_effects_p (cond)
-          && (!FLOAT_MODE_P (mode) || !HONOR_NANS (mode))
+          && !HONOR_NANS (mode)
           && rtx_equal_p (XEXP (cond, 0), true_rtx)
           && rtx_equal_p (XEXP (cond, 1), false_rtx))
     return true_rtx;