diff options
author | Richard Guenther <rguenther@suse.de> | 2008-04-17 09:09:31 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-04-17 09:09:31 +0000 |
commit | ba2e189251286ceb6830a36bbbf44d20bda1e29a (patch) | |
tree | f8f7712b31bdddfc402983df7bb2949ee076e2cb /gcc/fold-const.c | |
parent | 499928c1545bc0ff97231760e8552cb66873640b (diff) | |
download | gcc-ba2e189251286ceb6830a36bbbf44d20bda1e29a.zip gcc-ba2e189251286ceb6830a36bbbf44d20bda1e29a.tar.gz gcc-ba2e189251286ceb6830a36bbbf44d20bda1e29a.tar.bz2 |
tree-vn.c (expressions_equal_p): Do not check type equality or compatibility before calling operand_equal_p.
2008-04-17 Richard Guenther <rguenther@suse.de>
* tree-vn.c (expressions_equal_p): Do not check type
equality or compatibility before calling operand_equal_p.
* fold-const.c (operand_equal_p): Check equivalence of
integer constants before bailing out due to signedness or
precision differences.
* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Ignore
spurious differences in type qualification. Ignore types
for COMPONENT_REFs at all.
* gcc.dg/tree-ssa/ssa-fre-17.c: New testcase.
From-SVN: r134384
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index c145178..4e46761 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3026,6 +3026,11 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags) if (TREE_CODE (arg0) == ERROR_MARK || TREE_CODE (arg1) == ERROR_MARK) return 0; + /* Check equality of integer constants before bailing out due to + precision differences. */ + if (TREE_CODE (arg0) == INTEGER_CST && TREE_CODE (arg1) == INTEGER_CST) + return tree_int_cst_equal (arg0, arg1); + /* If both types don't have the same signedness, then we can't consider them equal. We must check this before the STRIP_NOPS calls because they may change the signedness of the arguments. */ |