diff mbox

Testcases for PR61786

Message ID alpine.LSU.2.11.1407141318330.19154@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener July 14, 2014, 11:19 a.m. UTC
Fixed by the PR61757 fix.

Richard.

2014-06-14  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/61786
	* gcc.dg/torture/pr61786.c: New testcase.
	* gcc.dg/lto/pr61786_0.c: Likewise.
	* gcc.dg/lto/pr61786_1.c: Likewise.
diff mbox

Patch

Index: gcc/testsuite/gcc.dg/torture/pr61786.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr61786.c	(revision 0)
+++ gcc/testsuite/gcc.dg/torture/pr61786.c	(working copy)
@@ -0,0 +1,31 @@ 
+/* { dg-do run } */
+
+int a, *c = &a, d; 
+char b = 1;
+
+void
+fn1 ()
+{
+  d = 1;
+lbl:
+  if (b == d)
+    {
+      d = *c;
+      if (b)
+	goto lbl;
+    }
+}
+
+int
+fn2 ()
+{
+  fn1 ();
+  return 0;
+}
+
+int
+main ()
+{
+  fn2 ();
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/lto/pr61786_1.c
===================================================================
--- gcc/testsuite/gcc.dg/lto/pr61786_1.c	(revision 0)
+++ gcc/testsuite/gcc.dg/lto/pr61786_1.c	(working copy)
@@ -0,0 +1,8 @@ 
+int fn2 (void);
+
+int
+main ()
+{
+  fn2 ();
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/lto/pr61786_0.c
===================================================================
--- gcc/testsuite/gcc.dg/lto/pr61786_0.c	(revision 0)
+++ gcc/testsuite/gcc.dg/lto/pr61786_0.c	(working copy)
@@ -0,0 +1,27 @@ 
+/* { dg-lto-do run } */
+/* { dg-lto-options { { -flto } } } */
+/* { dg-extra-ld-options "-O" } */
+
+int a, *c = &a, d;
+char b = 1;
+
+void
+fn1 (void)
+{
+  d = 1;
+lbl:
+  if (b == d)
+    {
+      d = *c;
+      if (b)
+	goto lbl;
+    }
+}
+
+int
+fn2 (void)
+{
+  fn1 ();
+  return 0;
+}
+