function.c (expand_function_end): Don't init arg_pointer_save_area.

* function.c (expand_function_end): Don't init arg_pointer_save_area.
        (get_arg_pointer_save_area): New.  Create an init it here.
        (fix_lexical_addr): Use it.
        * function.h: Declare it.
        * builtins.c (expand_builtin_setjmp_receiver): Use it.
        * stmt.c (expand_nl_goto_receiver): Use it.

From-SVN: r45200
This commit is contained in:
Richard Henderson 2001-08-27 10:36:20 -07:00
parent 36d7136e99
commit 278ed2183f
5 changed files with 54 additions and 38 deletions

View File

@ -1,3 +1,12 @@
2001-08-27 Richard Henderson <rth@redhat.com>
* function.c (expand_function_end): Don't init arg_pointer_save_area.
(get_arg_pointer_save_area): New. Create an init it here.
(fix_lexical_addr): Use it.
* function.h: Declare it.
* builtins.c (expand_builtin_setjmp_receiver): Use it.
* stmt.c (expand_nl_goto_receiver): Use it.
2001-08-27 Richard Henderson <rth@redhat.com>
* final.c (final_scan_insn): Don't enter APP_ON mode for
@ -13,7 +22,7 @@
2001-08-25 Dan Nicolaescu <dann@ics.uci.edu>
* ssa-ccp.c (ssa_const_prop): Free ssa_edges.
* ssa-ccp.c (ssa_const_prop): Free ssa_edges.
2001-08-27 Alan Modra <amodra@bigpond.net.au>
@ -79,8 +88,8 @@ Sun Aug 26 20:25:44 2001 Denis Chertykov <denisc@overta.ru>
2001-08-26 Aldy Hernandez <aldyh@redhat.com>
* config/mips/mips.c (mips_function_value): Handle complex return
values.
* config/mips/mips.c (mips_function_value): Handle complex return
values.
2001-08-25 Hans-Peter Nilsson <hp@bitrange.com>

View File

@ -557,14 +557,9 @@ expand_builtin_setjmp_receiver (receiver_label)
#endif
{
/* Now restore our arg pointer from the address at which it
was saved in our stack frame.
If there hasn't be space allocated for it yet, make
some now. */
if (arg_pointer_save_area == 0)
arg_pointer_save_area
= assign_stack_local (Pmode, GET_MODE_SIZE (Pmode), 0);
was saved in our stack frame. */
emit_move_insn (virtual_incoming_args_rtx,
copy_to_reg (arg_pointer_save_area));
copy_to_reg (get_arg_pointer_save_area (cfun)));
}
}
#endif

View File

@ -5557,11 +5557,8 @@ fix_lexical_addr (addr, var)
#ifdef NEED_SEPARATE_AP
rtx addr;
if (fp->x_arg_pointer_save_area == 0)
fp->x_arg_pointer_save_area
= assign_stack_local_1 (Pmode, GET_MODE_SIZE (Pmode), 0, fp);
addr = fix_lexical_addr (XEXP (fp->x_arg_pointer_save_area, 0), var);
addr = get_arg_pointer_save_area (fp);
addr = fix_lexical_addr (XEXP (addr, 0), var);
addr = memory_address (Pmode, addr);
base = gen_rtx_MEM (Pmode, addr);
@ -6703,20 +6700,6 @@ expand_function_end (filename, line, end_bindings)
}
#endif
/* Save the argument pointer if a save area was made for it. */
if (arg_pointer_save_area)
{
/* arg_pointer_save_area may not be a valid memory address, so we
have to check it and fix it if necessary. */
rtx seq;
start_sequence ();
emit_move_insn (validize_mem (arg_pointer_save_area),
virtual_incoming_args_rtx);
seq = gen_sequence ();
end_sequence ();
emit_insn_before (seq, tail_recursion_reentry);
}
/* Initialize any trampolines required by this function. */
for (link = trampoline_list; link; link = TREE_CHAIN (link))
{
@ -7013,6 +6996,40 @@ expand_function_end (filename, line, end_bindings)
then you will lose. */
expand_fixups (get_insns ());
}
rtx
get_arg_pointer_save_area (f)
struct function *f;
{
rtx ret = f->x_arg_pointer_save_area;
if (! ret)
{
rtx seq;
ret = assign_stack_local_1 (Pmode, GET_MODE_SIZE (Pmode), 0, f);
f->x_arg_pointer_save_area = ret;
/* Save the arg pointer at the beginning of the function. The
generated stack slot may not be a valid memory address, so w
have to check it and fix it if necessary. */
start_sequence ();
emit_move_insn (validize_mem (ret), virtual_incoming_args_rtx);
seq = gen_sequence ();
end_sequence ();
if (f == cfun)
{
push_topmost_sequence ();
emit_insn_after (seq, get_insns ());
pop_topmost_sequence ();
}
else
emit_insn_before (seq, f->x_tail_recursion_reentry);
}
return ret;
}
/* Extend a vector that records the INSN_UIDs of INSNS (either a
sequence or a single insn). */

View File

@ -609,6 +609,8 @@ extern void clobber_return_register PARAMS ((void));
extern void use_return_register PARAMS ((void));
#endif
extern rtx get_arg_pointer_save_area PARAMS ((struct function *));
extern void init_virtual_regs PARAMS ((struct emit_status *));
/* Called once, at initialization, to initialize function.c. */

View File

@ -3490,16 +3490,9 @@ expand_nl_goto_receiver ()
#endif
{
/* Now restore our arg pointer from the address at which it
was saved in our stack frame.
If there hasn't be space allocated for it yet, make
some now. */
if (arg_pointer_save_area == 0)
arg_pointer_save_area
= assign_stack_local (Pmode, GET_MODE_SIZE (Pmode), 0);
was saved in our stack frame. */
emit_move_insn (virtual_incoming_args_rtx,
/* We need a pseudo here, or else
instantiate_virtual_regs_1 complains. */
copy_to_reg (arg_pointer_save_area));
copy_to_reg (get_arg_pointer_save_area (cfun)));
}
}
#endif