diff options
author | Jason Merrill <merrill@gnu.org> | 1996-03-26 00:17:01 +0000 |
---|---|---|
committer | Jason Merrill <merrill@gnu.org> | 1996-03-26 00:17:01 +0000 |
commit | 6d7306f76e1ce9f0a45c8206c3c256f6e1fe710e (patch) | |
tree | fbb56f455b5f3b468325acfd747c9ae6e5dbdd2d /gcc/function.c | |
parent | 65d8b1ce9fbf4b70cd210d04caf700b1506f617f (diff) | |
download | gcc-6d7306f76e1ce9f0a45c8206c3c256f6e1fe710e.zip gcc-6d7306f76e1ce9f0a45c8206c3c256f6e1fe710e.tar.gz gcc-6d7306f76e1ce9f0a45c8206c3c256f6e1fe710e.tar.bz2 |
(expand_function_start): Don't set up context_display
unless current_function_needs_context.
From-SVN: r11615
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 72 |
1 files changed, 38 insertions, 34 deletions
diff --git a/gcc/function.c b/gcc/function.c index bdbfa54..f6ffe09 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -5230,48 +5230,52 @@ expand_function_start (subr, parms_have_cleanups) use_variable (current_function_internal_arg_pointer); } - /* Fetch static chain values for containing functions. */ - tem = decl_function_context (current_function_decl); - /* If not doing stupid register allocation copy the static chain - pointer into a pseudo. If we have small register classes, copy the - value from memory if static_chain_incoming_rtx is a REG. If we do - stupid register allocation, we use the stack address generated above. */ - if (tem && ! obey_regdecls) + context_display = 0; + if (current_function_needs_context) { + /* Fetch static chain values for containing functions. */ + tem = decl_function_context (current_function_decl); + /* If not doing stupid register allocation copy the static chain + pointer into a pseudo. If we have small register classes, copy + the value from memory if static_chain_incoming_rtx is a REG. If + we do stupid register allocation, we use the stack address + generated above. */ + if (tem && ! obey_regdecls) + { #ifdef SMALL_REGISTER_CLASSES - /* If the static chain originally came in a register, put it back - there, then move it out in the next insn. The reason for - this peculiar code is to satisfy function integration. */ - if (GET_CODE (static_chain_incoming_rtx) == REG) - emit_move_insn (static_chain_incoming_rtx, last_ptr); + /* If the static chain originally came in a register, put it back + there, then move it out in the next insn. The reason for + this peculiar code is to satisfy function integration. */ + if (GET_CODE (static_chain_incoming_rtx) == REG) + emit_move_insn (static_chain_incoming_rtx, last_ptr); #endif - last_ptr = copy_to_reg (static_chain_incoming_rtx); - } + last_ptr = copy_to_reg (static_chain_incoming_rtx); + } - context_display = 0; - while (tem) - { - tree rtlexp = make_node (RTL_EXPR); + while (tem) + { + tree rtlexp = make_node (RTL_EXPR); - RTL_EXPR_RTL (rtlexp) = last_ptr; - context_display = tree_cons (tem, rtlexp, context_display); - tem = decl_function_context (tem); - if (tem == 0) - break; - /* Chain thru stack frames, assuming pointer to next lexical frame - is found at the place we always store it. */ + RTL_EXPR_RTL (rtlexp) = last_ptr; + context_display = tree_cons (tem, rtlexp, context_display); + tem = decl_function_context (tem); + if (tem == 0) + break; + /* Chain thru stack frames, assuming pointer to next lexical frame + is found at the place we always store it. */ #ifdef FRAME_GROWS_DOWNWARD - last_ptr = plus_constant (last_ptr, - GET_MODE_SIZE (Pmode)); + last_ptr = plus_constant (last_ptr, - GET_MODE_SIZE (Pmode)); #endif - last_ptr = copy_to_reg (gen_rtx (MEM, Pmode, - memory_address (Pmode, last_ptr))); - - /* If we are not optimizing, ensure that we know that this - piece of context is live over the entire function. */ - if (! optimize) - save_expr_regs = gen_rtx (EXPR_LIST, VOIDmode, last_ptr, - save_expr_regs); + last_ptr = copy_to_reg (gen_rtx (MEM, Pmode, + memory_address (Pmode, last_ptr))); + + /* If we are not optimizing, ensure that we know that this + piece of context is live over the entire function. */ + if (! optimize) + save_expr_regs = gen_rtx (EXPR_LIST, VOIDmode, last_ptr, + save_expr_regs); + } } /* After the display initializations is where the tail-recursion label |