This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch i386]: Fix PR 56807
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 6 Dec 2013 18:06:14 +0100
- Subject: [patch i386]: Fix PR 56807
- Authentication-results: sourceware.org; auth=none
Hi,
ChangeLog
2013-12-06 Kai Tietz <ktietz@redhat.com>
PR target/56807
* config/i386/i386.c (ix86_expand_prologue):
Tested for i686-w64-mingw32, x86_64-unknown-linux-gnu. Ok for apply?
Regards,
Kai
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c (Revision 205719)
+++ config/i386/i386.c (Arbeitskopie)
@@ -10934,18 +10937,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, 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,
+ 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, allocate);
emit_move_insn (gen_rtx_REG (word_mode,
(eax_live ? AX_REG : R10_REG)),
gen_frame_mem (word_mode, t));