simplify-rtx.c (simplify_binary_operation): x * 1 is allowed when not honoring signal...
authorToon Moene <toon@moene.indiv.nluug.nl>
Fri, 2 Aug 2002 11:01:31 +0000 (13:01 +0200)
committerToon Moene <toon@gcc.gnu.org>
Fri, 2 Aug 2002 11:01:31 +0000 (11:01 +0000)
2002-08-02  Toon Moene  <toon@moene.indiv.nluug.nl>

* simplify-rtx.c (simplify_binary_operation): x * 1 is allowed
when not honoring signalling NaNs.
(simplify_ternary_operation): a == b has a definite value
when not honoring NaNs.

From-SVN: r55980

gcc/ChangeLog
gcc/simplify-rtx.c

index 4c3cb5797079a70d93945a9f130d07858c0221d7..9d0272e33aa9e89d7497c2590adbfb2bf85ac40f 100644 (file)
@@ -1,3 +1,10 @@
+2002-08-02  Toon Moene  <toon@moene.indiv.nluug.nl>
+
+       * simplify-rtx.c (simplify_binary_operation): x * 1 is allowed
+       when not honoring signalling NaNs.
+       (simplify_ternary_operation): a == b has a definite value
+       when not honoring NaNs.
+
 2002-08-02  Jason Merrill  <jason@redhat.com>
 
        * gdbinit.in (pct): New macro.
index 135846ca82fa926ae3fa8b910870ffac94f80bd3..14e8840d44773ad2c0b5e22591e1f9a5eb1cf815 100644 (file)
@@ -1169,10 +1169,10 @@ simplify_binary_operation (code, mode, op0, op1)
              && ! side_effects_p (op0))
            return op1;
 
-         /* In IEEE floating point, x*1 is not equivalent to x for nans.
-            However, ANSI says we can drop signals,
-            so we can do this anyway.  */
-         if (trueop1 == CONST1_RTX (mode))
+         /* In IEEE floating point, x*1 is not equivalent to x for
+            signalling NaNs.  */
+         if (!HONOR_SNANS (mode)
+             && trueop1 == CONST1_RTX (mode))
            return op0;
 
          /* Convert multiply by constant power of two into shift unless
@@ -2193,12 +2193,12 @@ simplify_ternary_operation (code, mode, op0_mode, op0, op1, op2)
 
       /* Convert a == b ? b : a to "a".  */
       if (GET_CODE (op0) == NE && ! side_effects_p (op0)
-         && (! FLOAT_MODE_P (mode) || flag_unsafe_math_optimizations)
+         && !HONOR_NANS (mode)
          && rtx_equal_p (XEXP (op0, 0), op1)
          && rtx_equal_p (XEXP (op0, 1), op2))
        return op1;
       else if (GET_CODE (op0) == EQ && ! side_effects_p (op0)
-         && (! FLOAT_MODE_P (mode) || flag_unsafe_math_optimizations)
+         && !HONOR_NANS (mode)
          && rtx_equal_p (XEXP (op0, 1), op1)
          && rtx_equal_p (XEXP (op0, 0), op2))
        return op2;