aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2006-11-23 00:11:15 +0100
committerZdenek Dvorak <rakdver@gcc.gnu.org>2006-11-22 23:11:15 +0000
commit0446c9f3a7f86ed71112170e8e9023d3ac526dde (patch)
tree466302702261d13e0284a991a22c4b62dc8aa24f /gcc/fold-const.c
parentcbad228156007fa24dda35b0a479b751ee12c9d2 (diff)
downloadgcc-0446c9f3a7f86ed71112170e8e9023d3ac526dde.zip
gcc-0446c9f3a7f86ed71112170e8e9023d3ac526dde.tar.gz
gcc-0446c9f3a7f86ed71112170e8e9023d3ac526dde.tar.bz2
re PR tree-optimization/29921 (internal compiler error: in set_lattice_value, at tree-ssa-ccp.c:437)
PR tree-optimization/29921 * fold-const.c (operand_equal_p): Without HONOR_SIGNED_ZEROS, consider signed and unsigned zero equal. * gcc.dg/pr29921.c: New test. From-SVN: r119102
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index cd7f1d9..b19b768 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -2584,8 +2584,19 @@ operand_equal_p (tree arg0, tree arg1, unsigned int flags)
return tree_int_cst_equal (arg0, arg1);
case REAL_CST:
- return REAL_VALUES_IDENTICAL (TREE_REAL_CST (arg0),
- TREE_REAL_CST (arg1));
+ if (REAL_VALUES_IDENTICAL (TREE_REAL_CST (arg0),
+ TREE_REAL_CST (arg1)))
+ return 1;
+
+
+ if (!HONOR_SIGNED_ZEROS (TYPE_MODE (TREE_TYPE (arg0))))
+ {
+ /* If we do not distinguish between signed and unsigned zero,
+ consider them equal. */
+ if (real_zerop (arg0) && real_zerop (arg1))
+ return 1;
+ }
+ return 0;
case VECTOR_CST:
{