Message ID | BANLkTikcR6OLzK5FvdkKZvqepBYF7JDTSQ@mail.gmail.com |
---|---|
State | New |
Headers | show |
> Attached one-liner fixes PR target/48723, ICE in > ix86_expand_prologue() with -fstack-check + function returning struct, > on corei7-avx. The problem was, that we forgot to update accounting > info when ix86_adjust_stack_and_probe adjusted stack pointer (in this > particular case, m->fs.sp_offset was set by stack realignment code for > AVX 32byte stack alignment. Take a look at line 10165 of config/i386/i386.c.
On Fri, Apr 22, 2011 at 11:38 PM, Eric Botcazou <ebotcazou@adacore.com> wrote: >> Attached one-liner fixes PR target/48723, ICE in >> ix86_expand_prologue() with -fstack-check + function returning struct, >> on corei7-avx. The problem was, that we forgot to update accounting >> info when ix86_adjust_stack_and_probe adjusted stack pointer (in this >> particular case, m->fs.sp_offset was set by stack realignment code for >> AVX 32byte stack alignment. > > Take a look at line 10165 of config/i386/i386.c. I have reverted my original patch. Uros.
Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 172860) +++ config/i386/i386.c (working copy) @@ -10628,6 +10628,7 @@ ix86_expand_prologue (void) if (STACK_CHECK_MOVING_SP) { ix86_adjust_stack_and_probe (allocate); + m->fs.sp_offset += allocate; allocate = 0; } else Index: testsuite/gcc.target/i386/pr48723.c =================================================================== --- testsuite/gcc.target/i386/pr48723.c (revision 0) +++ testsuite/gcc.target/i386/pr48723.c (revision 0) @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-fstack-check -mavx" } */ + +struct S0 +{ + int f0, f1, f2, f3; +} g_106; + +struct S0 +func_99 () +{ + return (g_106); +}