From a811a0a8815a893b0fac82e79ea251bb1554f720 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 9 Jan 2019 11:16:10 +0100 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 +++++ gcc/function.c | 4 +++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr88331.c | 30 +++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr88331.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 29759adf462..4d2173fc742 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-01-09 Jakub Jelinek + + 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 * doc/invoke.texi (-Os): Remove trailing spaces. diff --git a/gcc/function.c b/gcc/function.c index cec344bdac8..4ba57becb73 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 47b6116845f..658f396c26f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-01-09 Jakub Jelinek + + PR rtl-optimization/88331 + * gcc.target/i386/pr88331.c: New test. + 2019-01-08 Paolo Carlini * 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 00000000000..dbc63774bb7 --- /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; +} -- 2.30.2