]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/58640 (wrong code (segfaults) at -O3 on x86_64-linux-gnu)
authorRichard Biener <rguenther@suse.de>
Mon, 14 Oct 2013 09:17:20 +0000 (09:17 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 14 Oct 2013 09:17:20 +0000 (09:17 +0000)
2013-10-14  Richard Biener  <rguenther@suse.de>

PR tree-optimization/58640
* gcc.c-torture/execute/pr58640-2.c: New testcase.

From-SVN: r203516

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr58640-2.c [new file with mode: 0644]

index a364e7446b0768146f27c2913a6923e3acff19ef..96f7cb235a14c4e5f0df2e9cf24739b5a4d55aa5 100644 (file)
@@ -1,3 +1,8 @@
+2013-10-14  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/58640
+       * gcc.c-torture/execute/pr58640-2.c: New testcase.
+
 2013-10-13  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/uninit_array.ad[sn]: New test.
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr58640-2.c b/gcc/testsuite/gcc.c-torture/execute/pr58640-2.c
new file mode 100644 (file)
index 0000000..3fc3a55
--- /dev/null
@@ -0,0 +1,35 @@
+extern void abort (void);
+
+int a[20], b, c; 
+
+int
+fn1 ()
+{
+  int d, e, f, g = 0; 
+
+  a[12] = 1;
+  for (e = 0; e < 3; e++)
+    for (d = 0; d < 2; d++)
+      {
+       for (f = 0; f < 2; f++)
+         {
+           g ^= a[12] > 1;
+           if (g)
+             return 0;
+           if (b)
+             break;
+         }
+       for (c = 0; c < 1; c++)
+         a[d] = a[e * 3 + 9]; 
+      }
+  return 0;
+}
+
+int
+main ()
+{
+  fn1 ();
+  if (a[0] != 0)
+    abort ();
+  return 0;
+}