summaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-02-10 16:52:07 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-02-10 16:52:07 +0000
commite1b11b0513310e407b46b1c7fe86dab97eba038c (patch)
treec306e590d9ae4d96f7840c95f63704607326082f /gcc/tree-vrp.c
parent22c1d3019e6a942f8f11eb6cb3ec036343e8b6e3 (diff)
downloadgcc-e1b11b0513310e407b46b1c7fe86dab97eba038c.tar.gz
2010-02-10 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43017 * tree-vrp.c (vrp_int_const_binop): Trust int_const_binop for wrapping signed arithmetic. * gcc.dg/torture/pr43017.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156666 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 73dcf23a558..81645485f8b 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -1937,6 +1937,10 @@ vrp_int_const_binop (enum tree_code code, tree val1, tree val2)
}
}
+ else if (TYPE_OVERFLOW_WRAPS (TREE_TYPE (val1)))
+ /* If the singed operation wraps then int_const_binop has done
+ everything we want. */
+ ;
else if ((TREE_OVERFLOW (res)
&& !TREE_OVERFLOW (val1)
&& !TREE_OVERFLOW (val2))