Patchwork Testcase for fixed PR52589

login
register
mail settings
Submitter Richard Guenther
Date June 29, 2012, 1:14 p.m.
Message ID <alpine.LNX.2.00.1206291514220.17233@jbgna.fhfr.qr>
Download mbox | patch
Permalink /patch/168076/
State New
Headers show

Comments

Richard Guenther - June 29, 2012, 1:14 p.m.
Tested on x86_64-unknown-linux-gnu, applied.

Richard.

2012-06-29  Richard Guenther  <rguenther@suse.de>

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

Patch

Index: testsuite/gcc.dg/tree-ssa/vrp70.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/vrp70.c	(revision 0)
+++ testsuite/gcc.dg/tree-ssa/vrp70.c	(working copy)
@@ -0,0 +1,27 @@ 
+/* { dg-do compile } */
+/* { 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" } } */