aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-04-24 19:10:55 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-04-24 19:10:55 +0000
commit77a302647e6de91919e0e9c8c2383326715e4eee (patch)
tree97a0566806e8184e997baf818e519cac788dd9bd /gcc/testsuite/gcc.dg
parent2b6da65c33c24de56b95b42c5dd2c771c425ef7c (diff)
downloadgcc-77a302647e6de91919e0e9c8c2383326715e4eee.zip
gcc-77a302647e6de91919e0e9c8c2383326715e4eee.tar.gz
gcc-77a302647e6de91919e0e9c8c2383326715e4eee.tar.bz2
tree-vrp.c (extract_range_from_binary_expr): Handle overflow from unsigned additions.
2009-04-24 Richard Guenther <rguenther@suse.de> * tree-vrp.c (extract_range_from_binary_expr): Handle overflow from unsigned additions. * gcc.dg/tree-ssa/vrp48.c: New testcase. From-SVN: r146742
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/vrp48.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp48.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp48.c
new file mode 100644
index 0000000..a8cf8db
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp48.c
@@ -0,0 +1,20 @@
+extern void link_failure (void);
+
+static int __attribute__ ((noinline)) foo (int x)
+{
+ if (x >= 1)
+ if (x <= 10)
+ {
+ if (x < 1 || x > 10)
+ link_failure ();
+ x = x + 1;
+ }
+ return x;
+}
+
+int main (void)
+{
+ int i = foo (0);
+ return 0;
+}
+