aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-02-09 11:34:28 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-02-09 11:34:28 +0000
commit9605a6060a15c8d9295b033bc847b352b1280219 (patch)
tree4f9727618b68994094a646267710d8c5a27e1d36 /gcc/tree-vrp.c
parent5e1d6b4c155e1ae3ee7e1ce572f2a5d669bffe9a (diff)
downloadgcc-9605a6060a15c8d9295b033bc847b352b1280219.zip
gcc-9605a6060a15c8d9295b033bc847b352b1280219.tar.gz
gcc-9605a6060a15c8d9295b033bc847b352b1280219.tar.bz2
re PR tree-optimization/43000 (VRP miscompiles python with -fwrapv)
2010-02-09 Richard Guenther <rguenther@suse.de> PR tree-optimization/43000 * tree-vrp.c (vrp_int_const_binop): Only handle unsigned arithmetic manually. * gcc.dg/torture/pr43000.c: New testcase. * gcc.dg/torture/pr43002.c: Likewise. From-SVN: r156621
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index c1ba16a..73dcf23 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -1898,9 +1898,9 @@ vrp_int_const_binop (enum tree_code code, tree val1, tree val2)
res = int_const_binop (code, val1, val2, 0);
- /* If we are not using wrapping arithmetic, operate symbolically
- on -INF and +INF. */
- if (TYPE_OVERFLOW_WRAPS (TREE_TYPE (val1)))
+ /* If we are using unsigned arithmetic, operate symbolically
+ on -INF and +INF as int_const_binop only handles signed overflow. */
+ if (TYPE_UNSIGNED (TREE_TYPE (val1)))
{
int checkz = compare_values (res, val1);
bool overflow = false;