re PR rtl-optimization/68250 (wrong code at -O2 and -O3 on x86_64-linux-gnu (in 64...
authorJakub Jelinek <jakub@redhat.com>
Fri, 27 Nov 2015 12:12:35 +0000 (13:12 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 27 Nov 2015 12:12:35 +0000 (13:12 +0100)
PR rtl-optimization/68250
* gcc.c-torture/execute/pr68250.c: New test.

From-SVN: r231009

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

index fe39c939e463962c831d4023b49c8c0302babd18..b5b837d41e2a4dd1b2b0b0e824d03bab25cf6dca 100644 (file)
@@ -1,3 +1,8 @@
+2015-11-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/68250
+       * gcc.c-torture/execute/pr68250.c: New test.
+
 2015-11-27  Marek Polacek  <polacek@redhat.com>
 
        * gcc.dg/pr63568.c: Convert to GIMPLE.
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr68250.c b/gcc/testsuite/gcc.c-torture/execute/pr68250.c
new file mode 100644 (file)
index 0000000..f00234a
--- /dev/null
@@ -0,0 +1,40 @@
+/* PR rtl-optimization/68250 */
+
+signed char a, b, h, k, l, m, o;
+short c, d, n;
+int e, f, g, j, q;
+
+void
+fn1 (void)
+{
+  int p = b || a;
+  n = o > 0 || d > 1 >> o ? d : d << o;
+  for (; j; j++)
+    m = c < 0 || m || c << p;
+  l = f + 1;
+  for (; f < 1; f = 1)
+    k = h + 1;
+}
+
+__attribute__((noinline, noclone)) void
+fn2 (int k)
+{
+  if (k != 1)
+    __builtin_abort ();
+}
+
+int
+main ()
+{
+  signed char i;
+  for (; e < 1; e++)
+    {
+      fn1 ();
+      if (k)
+       i = k;
+      if (i > q)
+       g = 0;
+    }
+  fn2 (k);
+  return 0;
+}