aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1999-10-31 04:22:46 +0000
committerJeff Law <law@gcc.gnu.org>1999-10-30 22:22:46 -0600
commit0d19c2a1393340a3aea32e0a57d87141801020fe (patch)
tree27be06e7faea8aa15fe3f04d0f78027a76ce6e98 /gcc/fold-const.c
parentf6e8b583c4d79ce013c72d22b75d075c50c5e666 (diff)
downloadgcc-0d19c2a1393340a3aea32e0a57d87141801020fe.zip
gcc-0d19c2a1393340a3aea32e0a57d87141801020fe.tar.gz
gcc-0d19c2a1393340a3aea32e0a57d87141801020fe.tar.bz2
fold-const.c (fold): Fix thinko when optimizing comparisons against -0.0.
* fold-const.c (fold): Fix thinko when optimizing comparisons against -0.0. From-SVN: r30282
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index f633fa8..49f61b8 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -5751,7 +5751,8 @@ fold (expr)
REAL_VALUE_NEGATE (TREE_REAL_CST (arg1)))));
/* IEEE doesn't distinguish +0 and -0 in comparisons. */
/* a CMP (-0) -> a CMP 0 */
- if (REAL_VALUE_MINUS_ZERO (TREE_REAL_CST (arg1)))
+ if (TREE_CODE (arg1) == REAL_CST
+ && REAL_VALUE_MINUS_ZERO (TREE_REAL_CST (arg1)))
return fold (build (code, type, arg0,
build_real (TREE_TYPE (arg1), dconst0)));
}