Commit f997b875 by Kai Tietz Committed by Kai Tietz

re PR target/45694 ([MinGW64] fortran host associated variables+optimization==failure?)

2010-09-21  Kai Tietz  <kai.tietz@onevision.com>

        PR target/45694
        * config/i386/i386.c (ix86_expand_prologue): Save r10 in case that
        static chain-register is used for 64-bit.

From-SVN: r164489
parent 54394f4d
2010-09-21 Kai Tietz <kai.tietz@onevision.com>
PR target/45694
* config/i386/i386.c (ix86_expand_prologue): Save r10 in case that
static chain-register is used for 64-bit.
2010-09-21 Richard Guenther <rguenther@suse.de>
* dwarf2out.c (is_cu_die): New function.
......
......@@ -9692,19 +9692,27 @@ ix86_expand_prologue (void)
}
else
{
rtx eax = gen_rtx_REG (Pmode, AX_REG);
bool eax_live;
rtx eax = gen_rtx_REG (Pmode, AX_REG);;
rtx r10 = NULL;
bool eax_live = false;
bool r10_live = false;
if (cfun->machine->call_abi == MS_ABI)
eax_live = false;
else
eax_live = ix86_eax_live_at_start_p ();
if (TARGET_64BIT)
r10_live = (DECL_STATIC_CHAIN (current_function_decl) != 0);
if (!TARGET_64BIT_MS_ABI)
eax_live = ix86_eax_live_at_start_p ();
if (eax_live)
{
emit_insn (gen_push (eax));
allocate -= UNITS_PER_WORD;
}
if (r10_live)
{
r10 = gen_rtx_REG (Pmode, R10_REG);
emit_insn (gen_push (r10));
allocate -= UNITS_PER_WORD;
}
emit_move_insn (eax, GEN_INT (allocate));
......@@ -9720,11 +9728,18 @@ ix86_expand_prologue (void)
}
m->fs.sp_offset += allocate;
if (eax_live)
{
if (r10_live && eax_live)
{
t = choose_baseaddr (m->fs.sp_offset - allocate);
emit_move_insn (r10, gen_frame_mem (Pmode, t));
t = choose_baseaddr (m->fs.sp_offset - allocate - UNITS_PER_WORD);
emit_move_insn (eax, gen_frame_mem (Pmode, t));
}
else if (eax_live || r10_live)
{
t = choose_baseaddr (m->fs.sp_offset - allocate);
emit_move_insn ((eax_live ? eax : r10), gen_frame_mem (Pmode, t));
}
}
gcc_assert (m->fs.sp_offset == frame.stack_pointer_offset);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment