re PR target/60516 (cc1plus crashes compiling a method with a huge struct as argument)
authorJakub Jelinek <jakub@redhat.com>
Mon, 17 Mar 2014 19:03:04 +0000 (20:03 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 17 Mar 2014 19:03:04 +0000 (20:03 +0100)
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

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

index b7c5578251d34561a035b650bd1e927e3f1664a1..1f8e1302ed9f6e87eed94c013b6c800721458e5b 100644 (file)
@@ -1,3 +1,9 @@
+2014-03-17  Jakub Jelinek  <jakub@redhat.com>
+
+       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  <polacek@redhat.com>
 
        PR middle-end/60534
index 64b8e0a956b014a3dc27b4de53d2c64581f131f9..bd7fef0bfadf242c287d929a462524e2e7c80ea0 100644 (file)
@@ -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;
index 51cdaaf738a38f5644dfc3ca9da69390e20e8aa8..e887fb193af2a48dc578597893ff0e855e175ccb 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/60516
+       * gcc.target/i386/pr60516.c: New test.
+
 2014-03-17  Paolo Carlini  <paolo.carlini@oracle.com>
 
        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 (file)
index 0000000..575c8b6
--- /dev/null
@@ -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)
+{
+}