xtensa.c (machine_function): Add vararg_a7_copy.

* config/xtensa/xtensa.c (machine_function): Add vararg_a7_copy.
        (xtensa_copy_incoming_a7): Use start_sequence instead of
        push_to_sequence.  Stash insns in vararg_a7_copy for builtin_saveregs.
        (xtensa_builtin_saveregs): Place code from vararg_a7_copy at the start
        of the saveregs sequence.

From-SVN: r128447
This commit is contained in:
Bob Wilson
2007-09-12 21:47:59 +00:00
committed by Bob Wilson
parent bdb567c7f6
commit faa186b202
2 changed files with 19 additions and 5 deletions

View File

@@ -1,3 +1,11 @@
2007-09-12 Bob Wilson <bob.wilson@acm.org>
* config/xtensa/xtensa.c (machine_function): Add vararg_a7_copy.
(xtensa_copy_incoming_a7): Use start_sequence instead of
push_to_sequence. Stash insns in vararg_a7_copy for builtin_saveregs.
(xtensa_builtin_saveregs): Place code from vararg_a7_copy at the start
of the saveregs sequence.
2007-09-12 Richard Guenther <rguenther@suse.de>
PR middle-end/33382

View File

@@ -93,6 +93,7 @@ struct machine_function GTY(())
int accesses_prev_frame;
bool need_a7_copy;
bool vararg_a7;
rtx vararg_a7_copy;
rtx set_frame_ptr_insn;
};
@@ -1102,7 +1103,7 @@ xtensa_copy_incoming_a7 (rtx opnd)
/* Copy a7 to a new pseudo at the function entry. Use gen_raw_REG to
create the REG for a7 so that hard_frame_pointer_rtx is not used. */
push_to_sequence (entry_insns);
start_sequence ();
tmp = gen_reg_rtx (mode);
switch (mode)
@@ -1136,10 +1137,11 @@ xtensa_copy_incoming_a7 (rtx opnd)
if (cfun->machine->vararg_a7)
{
/* This is called from within builtin_savereg, so we're already
inside a start_sequence that will be placed at the start of
the function. */
emit_insn (entry_insns);
/* This is called from within builtin_saveregs, which will insert the
saveregs code at the function entry, ahead of anything placed at
the function entry now. Instead, save the sequence to be inserted
at the beginning of the saveregs code. */
cfun->machine->vararg_a7_copy = entry_insns;
}
else
{
@@ -1148,6 +1150,8 @@ xtensa_copy_incoming_a7 (rtx opnd)
chain current, so the code is placed at the start of the
function. */
push_topmost_sequence ();
/* Do not use entry_of_function() here. This is called from within
expand_function_start, when the CFG still holds GIMPLE. */
emit_insn_after (entry_insns, get_insns ());
pop_topmost_sequence ();
}
@@ -2100,6 +2104,8 @@ xtensa_builtin_saveregs (void)
cfun->machine->need_a7_copy = true;
cfun->machine->vararg_a7 = true;
move_block_from_reg (GP_ARG_FIRST + arg_words, dest, gp_left);
gcc_assert (cfun->machine->vararg_a7_copy != 0);
emit_insn_before (cfun->machine->vararg_a7_copy, get_insns ());
return XEXP (gp_regs, 0);
}