re PR tree-optimization/52589 (VRP missed optimization)
authorRichard Guenther <rguenther@suse.de>
Fri, 29 Jun 2012 13:17:44 +0000 (13:17 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 29 Jun 2012 13:17:44 +0000 (13:17 +0000)
2012-06-29  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/52589
* gcc.dg/tree-ssa/vrp70.c: New testcase.

From-SVN: r189073

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/vrp70.c [new file with mode: 0644]

index 52e5062404aa549433ce1a60a0b89eef7b368553..7709ae57bff2961bd7ac9f1bc1e8b76212eab839 100644 (file)
@@ -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 (file)
index 0000000..e9a7563
--- /dev/null
@@ -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" } } */