summaryrefslogtreecommitdiffstats
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-17 09:09:31 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-17 09:09:31 +0000
commit659ce413ebf46451f3b81dd2347e7705405dc5a6 (patch)
treef8f7712b31bdddfc402983df7bb2949ee076e2cb /gcc/fold-const.c
parent374b31eeb2b04a436ab55139b79a774f0225fbc1 (diff)
downloadppe42-gcc-659ce413ebf46451f3b81dd2347e7705405dc5a6.tar.gz
ppe42-gcc-659ce413ebf46451f3b81dd2347e7705405dc5a6.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134384 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index c1451789af0..4e467615dd1 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. */
OpenPOWER on IntegriCloud