aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Evans <dje@gnu.org>1994-12-09 21:06:03 +0000
committerDoug Evans <dje@gnu.org>1994-12-09 21:06:03 +0000
commit68c6b3a925e4432121539692ccb69b76f0cf2529 (patch)
treee2d8f045e8a8970bb6ced9f4b38d85e215cb6d4b
parent213ecac93cda962ad3eefc5f5231529c84f41650 (diff)
downloadgcc-68c6b3a925e4432121539692ccb69b76f0cf2529.zip
gcc-68c6b3a925e4432121539692ccb69b76f0cf2529.tar.gz
gcc-68c6b3a925e4432121539692ccb69b76f0cf2529.tar.bz2
(fold): Call real_zerop for real constants.
From-SVN: r8634
-rw-r--r--gcc/fold-const.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index e5184c0..e49fcfb 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -4724,7 +4724,9 @@ fold (expr)
/* If we have A op 0 ? A : -A, this is A, -A, abs (A), or abs (-A),
depending on the comparison operation. */
- if (integer_zerop (TREE_OPERAND (arg0, 1))
+ if ((FLOAT_TYPE_P (TREE_TYPE (TREE_OPERAND (arg0, 1)))
+ ? real_zerop (TREE_OPERAND (arg0, 1))
+ : integer_zerop (TREE_OPERAND (arg0, 1)))
&& TREE_CODE (arg2) == NEGATE_EXPR
&& operand_equal_p (TREE_OPERAND (arg2, 0), arg1, 0))
switch (comp_code)