diff options
author | Toon Moene <toon@moene.indiv.nluug.nl> | 2002-08-02 13:01:31 +0200 |
---|---|---|
committer | Toon Moene <toon@gcc.gnu.org> | 2002-08-02 11:01:31 +0000 |
commit | e3e16ee37de28de01bd197548cf3dd9a41cab92d (patch) | |
tree | 80947de2c0a402b92da9a5341fccbff49d0fd0c4 /gcc | |
parent | b9d8832d731aa639658f29bcc612bc45c85d7d62 (diff) | |
download | gcc-e3e16ee37de28de01bd197548cf3dd9a41cab92d.zip gcc-e3e16ee37de28de01bd197548cf3dd9a41cab92d.tar.gz gcc-e3e16ee37de28de01bd197548cf3dd9a41cab92d.tar.bz2 |
simplify-rtx.c (simplify_binary_operation): x * 1 is allowed when not honoring signalling NaNs.
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
Diffstat (limited to 'gcc')
-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; |