aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-06-29 13:17:44 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-06-29 13:17:44 +0000
commita1ebcd97b84956788ffc7dcd0950785f9395ff19 (patch)
tree191207b754ebc02d3707e93676c0dc9fbebd6e14 /gcc
parent8a8b3779de304fd1cb3a5504ab1eb3e07068e828 (diff)
downloadgcc-a1ebcd97b84956788ffc7dcd0950785f9395ff19.zip
gcc-a1ebcd97b84956788ffc7dcd0950785f9395ff19.tar.gz
gcc-a1ebcd97b84956788ffc7dcd0950785f9395ff19.tar.bz2
re PR tree-optimization/52589 (VRP missed optimization)
2012-06-29 Richard Guenther <rguenther@suse.de> PR tree-optimization/52589 * gcc.dg/tree-ssa/vrp70.c: New testcase. From-SVN: r189073
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/vrp70.c28
2 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 52e5062..7709ae5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-29 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/52589
+ * gcc.dg/tree-ssa/vrp70.c: New testcase.
+
2012-06-28 Janis Johnson <janisjo@codesourcery.com>
* g++.dg/cpp0x/nullptr19.c: Remove exta directives on same line.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp70.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp70.c
new file mode 100644
index 0000000..e9a7563
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp70.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+extern void link_error (void);
+
+void
+foo (unsigned int s)
+{
+ if (s + 0x70000000 < 0xf0000000U)
+ {
+ if (s >= 0x80000000U && s < 0x90000000U)
+ link_error ();
+ }
+}
+
+void
+bar (unsigned int s)
+{
+ if (s + 0x70000000 >= 0xf0000000U)
+ {
+ if (s < 0x80000000U || s >= 0x90000000U)
+ link_error ();
+ }
+}
+
+/* { dg-final { scan-tree-dump-not "link_error" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */