re PR rtl-optimization/88331 (ICE in rtl_verify_bb_layout, at cfgrtl.c:2987)
authorJakub Jelinek <jakub@redhat.com>
Wed, 9 Jan 2019 10:16:10 +0000 (11:16 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 9 Jan 2019 10:16:10 +0000 (11:16 +0100)
PR rtl-optimization/88331
* function.c (assign_stack_local_1): Don't set dynamic_align_addr if
not currently_expanding_to_rtl.

* gcc.target/i386/pr88331.c: New test.

From-SVN: r267758

gcc/ChangeLog
gcc/function.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr88331.c [new file with mode: 0644]

index 29759adf462c34c08dfcb96763f2e012069b1a37..4d2173fc7424c16bafd25e23c43062e6d5f95131 100644 (file)
@@ -1,3 +1,9 @@
+2019-01-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/88331
+       * function.c (assign_stack_local_1): Don't set dynamic_align_addr if
+       not currently_expanding_to_rtl.
+
 2019-01-09  Eric Botcazou  <ebotcazou@adacore.com>
 
        * doc/invoke.texi (-Os): Remove trailing spaces.
index cec344bdac8cd59ebca0364a165147d25f1e95cf..4ba57becb733ccdec85534a7cf55a2bd89d422a5 100644 (file)
@@ -400,7 +400,9 @@ assign_stack_local_1 (machine_mode mode, poly_int64 size,
     {
       /* If the required alignment exceeds MAX_SUPPORTED_STACK_ALIGNMENT and
         it is not OK to reduce it.  Align the slot dynamically.  */
-      if (mode == BLKmode && (kind & ASLK_REDUCE_ALIGN) == 0)
+      if (mode == BLKmode
+         && (kind & ASLK_REDUCE_ALIGN) == 0
+         && currently_expanding_to_rtl)
        dynamic_align_addr = true;
       else
        {
index 47b6116845ffd49a1f569cf3bd325d10f421c0ea..658f396c26f2a6a57ef62b1ccdd0e28b79dedbd1 100644 (file)
@@ -1,3 +1,8 @@
+2019-01-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/88331
+       * gcc.target/i386/pr88331.c: New test.
+
 2019-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * g++.dg/diagnostic/constexpr2.C: New.
diff --git a/gcc/testsuite/gcc.target/i386/pr88331.c b/gcc/testsuite/gcc.target/i386/pr88331.c
new file mode 100644 (file)
index 0000000..dbc6377
--- /dev/null
@@ -0,0 +1,30 @@
+/* PR rtl-optimization/88331 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=core-avx2" } */
+
+int b, d, e, g, i, j, l, m;
+int *c, *h, *n, *o;
+long f, k;
+
+void
+foo (void)
+{
+  long p = i;
+  int *a = o;
+  while (p)
+    {
+      n = (int *) (__UINTPTR_TYPE__) a[0];
+      for (; f; f += 4)
+       for (; m <= d;)
+         {
+           for (; g <= e; ++g)
+             l = (int) (__UINTPTR_TYPE__) (n + l);
+           c[m] = (int) (__UINTPTR_TYPE__) n;
+         }
+    }
+  int q = 0;
+  k = 0;
+  for (; k < j; k++)
+    q += o[k] * h[k];
+  b = q;
+}