From: Jakub Jelinek Date: Mon, 17 Mar 2014 19:03:04 +0000 (+0100) Subject: re PR target/60516 (cc1plus crashes compiling a method with a huge struct as argument) X-Git-Tag: releases/gcc-4.9.0~427 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e318c1e15dd56380235bae7b7eea41301ff5e931;p=thirdparty%2Fgcc.git re PR target/60516 (cc1plus crashes compiling a method with a huge struct as argument) PR target/60516 * config/i386/i386.c (ix86_expand_epilogue): Adjust REG_CFA_ADJUST_CFA note creation for the 2010-08-31 changes. * gcc.target/i386/pr60516.c: New test. From-SVN: r208623 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b7c5578251d3..1f8e1302ed9f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-03-17 Jakub Jelinek + + PR target/60516 + * config/i386/i386.c (ix86_expand_epilogue): Adjust REG_CFA_ADJUST_CFA + note creation for the 2010-08-31 changes. + 2014-03-17 Marek Polacek PR middle-end/60534 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 64b8e0a956b0..bd7fef0bfadf 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -11708,8 +11708,9 @@ ix86_expand_epilogue (int style) m->fs.cfa_offset -= UNITS_PER_WORD; m->fs.sp_offset -= UNITS_PER_WORD; - add_reg_note (insn, REG_CFA_ADJUST_CFA, - copy_rtx (XVECEXP (PATTERN (insn), 0, 1))); + rtx x = plus_constant (Pmode, stack_pointer_rtx, UNITS_PER_WORD); + x = gen_rtx_SET (VOIDmode, stack_pointer_rtx, x); + add_reg_note (insn, REG_CFA_ADJUST_CFA, x); add_reg_note (insn, REG_CFA_REGISTER, gen_rtx_SET (VOIDmode, ecx, pc_rtx)); RTX_FRAME_RELATED_P (insn) = 1; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 51cdaaf738a3..e887fb193af2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-03-17 Jakub Jelinek + + PR target/60516 + * gcc.target/i386/pr60516.c: New test. + 2014-03-17 Paolo Carlini PR c++/59571 diff --git a/gcc/testsuite/gcc.target/i386/pr60516.c b/gcc/testsuite/gcc.target/i386/pr60516.c new file mode 100644 index 000000000000..575c8b61d1ee --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr60516.c @@ -0,0 +1,20 @@ +/* PR target/60516 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +struct S { char c[65536]; }; + +__attribute__((ms_abi, thiscall)) void +foo (void *x, struct S y) +{ +} + +__attribute__((ms_abi, fastcall)) void +bar (void *x, void *y, struct S z) +{ +} + +__attribute__((ms_abi, stdcall)) void +baz (struct S x) +{ +}