http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56807

--- Comment #5 from Kai Tietz <ktietz at gcc dot gnu.org> ---
Yeah, the issue is the use of frame-pointer ...  instead we should use here
stack-pointer relative addressing as we are that way realigned stack-pointer
agnostic.

Following patch solves the issue.  Could you give it a try?

Index: i386.c
===================================================================
--- i386.c    (Revision 205719)
+++ i386.c    (Arbeitskopie)
@@ -10934,18 +10934,21 @@ ix86_expand_prologue (void)
     }
       m->fs.sp_offset += allocate;

+      /* Use stack_pointer_rtx for relative addressing so that code
+     works for realigned stack, too.  */
       if (r10_live && eax_live)
         {
-      t = choose_baseaddr (m->fs.sp_offset - allocate);
+      t = plus_constant (Pmode, stack_pointer_rtx, 0 - allocate);
       emit_move_insn (gen_rtx_REG (word_mode, R10_REG),
               gen_frame_mem (word_mode, t));
-      t = choose_baseaddr (m->fs.sp_offset - allocate - UNITS_PER_WORD);
+      t = plus_constant (Pmode, stack_pointer_rtx,
+                 0 - allocate - 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 = choose_baseaddr (m->fs.sp_offset - allocate);
+      t = plus_constant (Pmode, stack_pointer_rtx, 0 - allocate);
       emit_move_insn (gen_rtx_REG (word_mode,
                        (eax_live ? AX_REG : R10_REG)),
               gen_frame_mem (word_mode, t));

Reply via email to