]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/60193 (ICE on big nested frame)
authorKai Tietz <ktietz@redhat.com>
Tue, 18 Feb 2014 13:46:38 +0000 (14:46 +0100)
committerKai Tietz <ktietz@gcc.gnu.org>
Tue, 18 Feb 2014 13:46:38 +0000 (14:46 +0100)
2014-02-18  Kai Tietz  <ktietz@redhat.com>

Backport from mainline
PR target/60193
* config/i386/i386.c (ix86_expand_prologue): Use
rax register as displacement for restoring %r10, %rax.
Additional fix wrong offset for restoring both-registers.

2014-02-18  Kai Tietz  <ktietz@redhat.com>

PR target/60193
* gcc.target/i386/nest-1.c: New testcase.

From-SVN: r207846

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

index b5e716017493ccf92aa6a5458684a3a72b2e58d4..2985bfab12c0be4a002bd94197a878a4909ffe2e 100644 (file)
@@ -1,3 +1,11 @@
+2014-02-18  Kai Tietz  <ktietz@redhat.com>
+
+       Backport from mainline
+       PR target/60193
+       * config/i386/i386.c (ix86_expand_prologue): Use
+       rax register as displacement for restoring %r10, %rax.
+       Additional fix wrong offset for restoring both-registers.
+
 2014-02-18  Eric Botcazou  <ebotcazou@adacore.com>
 
        * ipa-prop.c (compute_complex_ancestor_jump_func): Replace overzealous
index 25ec81420538b2bff04655ef2c8f964fea924b02..d4c02bc61b1d6f3e4b50fa790e173f50d3bfe334 100644 (file)
@@ -10434,15 +10434,14 @@ ix86_expand_prologue (void)
 
       if (r10_live && eax_live)
         {
-         t = plus_constant (stack_pointer_rtx, allocate);
+         t = gen_rtx_PLUS (Pmode, stack_pointer_rtx, eax);
          emit_move_insn (r10, gen_frame_mem (Pmode, t));
-         t = plus_constant (stack_pointer_rtx,
-                            allocate - UNITS_PER_WORD);
+         t = plus_constant (t, UNITS_PER_WORD);
          emit_move_insn (eax, gen_frame_mem (Pmode, t));
        }
       else if (eax_live || r10_live)
        {
-         t = plus_constant (stack_pointer_rtx, allocate);
+         t = gen_rtx_PLUS (Pmode, stack_pointer_rtx, eax);
          emit_move_insn ((eax_live ? eax : r10), gen_frame_mem (Pmode, t));
        }
     }
index 4f8229b93b2b16a2ea5d4234d3187db1752cb6e7..9cca8d78779e15de5482939f721e256c00e99736 100644 (file)
@@ -1,3 +1,8 @@
+2014-02-18  Kai Tietz  <ktietz@redhat.com>
+
+       PR target/60193
+       * gcc.target/i386/nest-1.c: New testcase.
+
 2014-02-18  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/opt32.adb: New test.
diff --git a/gcc/testsuite/gcc.target/i386/nest-1.c b/gcc/testsuite/gcc.target/i386/nest-1.c
new file mode 100644 (file)
index 0000000..ba75350
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile { target llp64 } } */
+/* { dg-options "" } */
+
+void foo (int i)
+{
+  void nested (void)
+  {
+    char arr[(1U << 31) + 4U];
+    arr[i] = 0;
+  }
+
+  nested ();
+}
+