aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-01-09 11:16:10 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-01-09 11:16:10 +0100
commita811a0a8815a893b0fac82e79ea251bb1554f720 (patch)
treeae4de83d60cbc951db2bcd71518f6fd2c0be272b /gcc
parentc86fab9d08853121dfe3d001b973af1e1c44fddd (diff)
downloadgcc-a811a0a8815a893b0fac82e79ea251bb1554f720.zip
gcc-a811a0a8815a893b0fac82e79ea251bb1554f720.tar.gz
gcc-a811a0a8815a893b0fac82e79ea251bb1554f720.tar.bz2
re PR rtl-optimization/88331 (ICE in rtl_verify_bb_layout, at cfgrtl.c:2987)
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/function.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/i386/pr88331.c30
4 files changed, 44 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 29759ad..4d2173f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/function.c b/gcc/function.c
index cec344b..4ba57be 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -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
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 47b6116..658f396 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..dbc6377
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr88331.c
@@ -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;
+}