Testcase for PR52996

Submitted by Richard Guenther on Dec. 21, 2012, 10:30 a.m.

Details

Message ID alpine.LNX.2.00.1212211129560.6889@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Guenther Dec. 21, 2012, 10:30 a.m.
The testcase in the PR no longer reproduces its issue.

Tested on x86_64-unknown-linux-gnu, applied.

Richard.

2012-12-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/52996
	* gcc.dg/torture/pr52996.c: New testcase.

Patch hide | download patch | download mbox

Index: testsuite/gcc.dg/torture/pr52996.c
===================================================================
--- testsuite/gcc.dg/torture/pr52996.c	(revision 0)
+++ testsuite/gcc.dg/torture/pr52996.c	(working copy)
@@ -0,0 +1,33 @@ 
+/* { dg-do compile } */
+/* { dg-options "-funswitch-loops" } */
+
+int a, b, c, d, e, f;
+void
+fn1 ()
+{
+    int g, h;
+lbl_173:
+    if (a)
+        c++;
+lbl_158:
+    e = 0;
+    h = 0;
+    for (; h > -8; h--)
+    {
+        g = 0;
+        for (; g <= 0; g += 1)
+        {
+            d = 1;
+            for (; d >= 0; d -= 1)
+                a = 1;
+            if (b)
+                break;
+            if (f)
+                return;
+            if (h)
+                goto lbl_158;
+        }
+    }
+    goto lbl_173;
+}
+