]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/60516 (cc1plus crashes compiling a method with a huge struct...
authorJakub Jelinek <jakub@redhat.com>
Thu, 10 Apr 2014 07:49:02 +0000 (09:49 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 10 Apr 2014 07:49:02 +0000 (09:49 +0200)
Backport from mainline
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.

* gcc.target/i386/pr60516.c: New test.

From-SVN: r209264

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

index e1335a8fbfa7858a61a58c8a7ce14942052a5e1e..49d08ad3b2a89aa9cfee40e15378d2372646dbc6 100644 (file)
@@ -1,6 +1,12 @@
 2014-04-10  Jakub Jelinek  <jakub@redhat.com>
 
        Backport from mainline
+       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-06  Jakub Jelinek  <jakub@redhat.com>
                    Meador Inge  <meadori@codesourcery.com>
 
index 402dec8d9d6a0a1dcc683159be1623d0b4cc05b0..dbcbfd5819988bc0a48976e074375c940d1e745d 100644 (file)
@@ -11128,8 +11128,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 4d7db8f00d06fb8f69108d4212fc1b473c76a189..a7a984d1cf43aa6136ddddba70d04efe179c8100 100644 (file)
@@ -1,6 +1,11 @@
 2014-04-10  Jakub Jelinek  <jakub@redhat.com>
 
        Backport from mainline
+       2014-03-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/60516
+       * gcc.target/i386/pr60516.c: New test.
+
        2014-03-13  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/36282
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)
+{
+}