diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-04-06 07:21:12 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-04-06 07:21:12 -0400 |
commit | f0c51a1e34252c672a6ce100209a277d15529ce4 (patch) | |
tree | 4d3ade52ac4ac6fb1581e3b5a67d54c8b604c7a1 /gcc | |
parent | 8b0f91011f1ed67e185e3b777a663858d1631821 (diff) | |
download | gcc-f0c51a1e34252c672a6ce100209a277d15529ce4.zip gcc-f0c51a1e34252c672a6ce100209a277d15529ce4.tar.gz gcc-f0c51a1e34252c672a6ce100209a277d15529ce4.tar.bz2 |
(expand_function_start): Delay copying static chain.
From-SVN: r6979
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/function.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/function.c b/gcc/function.c index 8726afb..22ea58b 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -4860,7 +4860,13 @@ expand_function_start (subr, parms_have_cleanups) if (current_function_needs_context) { last_ptr = assign_stack_local (Pmode, GET_MODE_SIZE (Pmode), 0); - emit_move_insn (last_ptr, static_chain_incoming_rtx); + +#ifdef SMALL_REGISTER_CLASSES + /* Delay copying static chain if it is not a register to avoid + conflicts with regs used for parameters. */ + if (GET_CODE (static_chain_incoming_rtx) == REG) +#endif + emit_move_insn (last_ptr, static_chain_incoming_rtx); } /* If the parameters of this function need cleaning up, get a label @@ -4976,6 +4982,15 @@ expand_function_start (subr, parms_have_cleanups) assign_parms (subr, 0); +#ifdef SMALL_REGISTER_CLASSES + /* Copy the static chain now if it wasn't a register. The delay is to + avoid conflicts with the parameter passing registers. */ + + if (current_function_needs_context) + if (GET_CODE (static_chain_incoming_rtx) != REG) + emit_move_insn (last_ptr, static_chain_incoming_rtx); +#endif + /* The following was moved from init_function_start. The move is supposed to make sdb output more accurate. */ /* Indicate the beginning of the function body, |