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

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: r207844

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

index 52665008d69d2e02a2c177198d196451b199ef0a..2c99044ae35c3353924837c333a4e0d41a00199d 100644 (file)
@@ -1,3 +1,10 @@
+2014-02-18  Kai Tietz  <ktietz@redhat.com>
+
+       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 0a15e442bef1ee715367e2260f42b34aa4c55add..8433fad65aee890fad680dca5cd0e420a096a73a 100644 (file)
@@ -11023,13 +11023,12 @@ ix86_expand_prologue (void)
       rtx r10 = NULL;
       rtx (*adjust_stack_insn)(rtx, rtx, rtx);
       const bool sp_is_cfa_reg = (m->fs.cfa_reg == stack_pointer_rtx);
-      bool eax_live = false;
+      bool eax_live = ix86_eax_live_at_start_p ();
       bool r10_live = false;
 
       if (TARGET_64BIT)
         r10_live = (DECL_STATIC_CHAIN (current_function_decl) != 0);
 
-      eax_live = ix86_eax_live_at_start_p ();
       if (eax_live)
        {
          insn = emit_insn (gen_push (eax));
@@ -11084,17 +11083,16 @@ ix86_expand_prologue (void)
         works for realigned stack, too.  */
       if (r10_live && eax_live)
         {
-         t = plus_constant (Pmode, stack_pointer_rtx, allocate);
+         t = gen_rtx_PLUS (Pmode, stack_pointer_rtx, eax);
          emit_move_insn (gen_rtx_REG (word_mode, R10_REG),
                          gen_frame_mem (word_mode, t));
-         t = plus_constant (Pmode, stack_pointer_rtx,
-                            allocate - UNITS_PER_WORD);
+         t = plus_constant (Pmode, t, UNITS_PER_WORD);
          emit_move_insn (gen_rtx_REG (word_mode, AX_REG),
                          gen_frame_mem (word_mode, t));
        }
       else if (eax_live || r10_live)
        {
-         t = plus_constant (Pmode, stack_pointer_rtx, allocate);
+         t = gen_rtx_PLUS (Pmode, stack_pointer_rtx, eax);
          emit_move_insn (gen_rtx_REG (word_mode,
                                       (eax_live ? AX_REG : R10_REG)),
                          gen_frame_mem (word_mode, t));
index 65c70b5287aaac873bbd589a97a5364fe04bb9be..337472ee37a12caec1ed5fbfc9ad9828dba01779 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 ();
+}
+
This page took 0.113986 seconds and 5 git commands to generate.