diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-12 16:28:01 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-12 16:28:01 +0000 |
commit | 8375344417d39f567bf83e2c1b3a5d941bc1c111 (patch) | |
tree | b55b0e708825d64adcda26d97ed19745dc046ede /gcc/fold-const.c | |
parent | f7074c966846b112edb6054d5f68540667dd9d3a (diff) | |
download | ppe42-gcc-8375344417d39f567bf83e2c1b3a5d941bc1c111.tar.gz ppe42-gcc-8375344417d39f567bf83e2c1b3a5d941bc1c111.zip |
* fold-const.c (fold_binary): Guard (X-X) -> 0 transformation
with !HONOR_NANS and !HONOR_INFINITIES.
* simplify-rtx.c (simplify_binary_operation_1): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125652 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 06b7c74a2b5..814d033ffc4 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -9585,7 +9585,10 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) Also note that operand_equal_p is always false if an operand is volatile. */ - if ((! FLOAT_TYPE_P (type) || flag_unsafe_math_optimizations) + if ((! FLOAT_TYPE_P (type) + || (flag_unsafe_math_optimizations + && !HONOR_NANS (TYPE_MODE (type)) + && !HONOR_INFINITIES (TYPE_MODE (type)))) && operand_equal_p (arg0, arg1, 0)) return fold_convert (type, integer_zero_node); |