]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2014-07-14 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Jul 2014 11:22:34 +0000 (11:22 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Jul 2014 11:22:34 +0000 (11:22 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212515 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/lto/pr61786_0.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/lto/pr61786_1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr61786.c [new file with mode: 0644]

index a2529fc17b3deb2a93e7d26bb27b5a61fff88c36..a6483a68ec1def221469546a134f298e51129298 100644 (file)
@@ -1,3 +1,10 @@
+2014-07-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.
+
 2014-07-14  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/61757
diff --git a/gcc/testsuite/gcc.dg/lto/pr61786_0.c b/gcc/testsuite/gcc.dg/lto/pr61786_0.c
new file mode 100644 (file)
index 0000000..442b5b2
--- /dev/null
@@ -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;
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/pr61786_1.c b/gcc/testsuite/gcc.dg/lto/pr61786_1.c
new file mode 100644 (file)
index 0000000..4cfd0aa
--- /dev/null
@@ -0,0 +1,8 @@
+int fn2 (void);
+
+int
+main ()
+{
+  fn2 ();
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr61786.c b/gcc/testsuite/gcc.dg/torture/pr61786.c
new file mode 100644 (file)
index 0000000..1e32a82
--- /dev/null
@@ -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;
+}