OSDN Git Service

2014-02-18 Kai Tietz <ktietz@redhat.com>
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Feb 2014 13:46:38 +0000 (13:46 +0000)
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Feb 2014 13:46:38 +0000 (13:46 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@207846 138bc75d-0d04-0410-961f-82ee72b054a4

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

index b5e7160..2985bfa 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 25ec814..d4c02bc 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 4f8229b..9cca8d7 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 ();
+}
+