re PR tree-optimization/57321 (static function call miscompiled at -Os and above)
authorJakub Jelinek <jakub@redhat.com>
Tue, 21 May 2013 07:51:59 +0000 (09:51 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 21 May 2013 07:51:59 +0000 (09:51 +0200)
PR tree-optimization/57321
* gcc.c-torture/execute/pr57321.c: New test.

From-SVN: r199133

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

index 41c2ce49dca52a2f33f0e10c3b54477239bcf0f7..f78e672b66b597f7f3ebc14a7d065d868e64595e 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/57321
+       * gcc.c-torture/execute/pr57321.c: New test.
+
 2013-05-20  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/48858
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr57321.c b/gcc/testsuite/gcc.c-torture/execute/pr57321.c
new file mode 100644 (file)
index 0000000..79b3d4d
--- /dev/null
@@ -0,0 +1,24 @@
+/* PR tree-optimization/57321 */
+
+int a = 1, *b, **c;
+
+static int
+foo (int *p)
+{
+  if (*p == a)
+    {
+      int *i[7][5] = { { 0 } };
+      int **j[1][1];
+      j[0][0] = &i[0][0];
+      *b = &p != c;
+    }
+  return 0;
+}
+
+int
+main ()
+{
+  int i = 0;
+  foo (&i);
+  return 0;
+}