aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 4c535c7..c34c191 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -6565,12 +6565,15 @@ expand_function_start (tree subr, int parms_have_cleanups)
/* If function gets a static chain arg, store it. */
if (cfun->static_chain_decl)
{
- rtx x;
+ tree parm = cfun->static_chain_decl;
+ rtx local = gen_reg_rtx (Pmode);
+
+ set_decl_incoming_rtl (parm, static_chain_incoming_rtx);
+ SET_DECL_RTL (parm, local);
+ maybe_set_unchanging (local, parm);
+ mark_reg_pointer (local, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (parm))));
- expand_var (cfun->static_chain_decl);
- x = expand_expr (cfun->static_chain_decl, NULL_RTX,
- VOIDmode, EXPAND_WRITE);
- emit_move_insn (x, static_chain_incoming_rtx);
+ emit_move_insn (local, static_chain_incoming_rtx);
}
/* If the function receives a non-local goto, then store the