diff options
| -rw-r--r-- | gcc/ChangeLog | 7 | ||||
| -rw-r--r-- | gcc/simplify-rtx.c | 12 |
2 files changed, 13 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4c3cb57..9d0272e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 135846c..14e8840 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -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; |
