aboutsummaryrefslogtreecommitdiff
path: root/gcc/df-scan.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-22 15:11:37 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-22 15:11:37 +0000
commit82c7907c61991be035c7cd5bbc8227b80ea98b22 (patch)
tree78521a0ca34823fbb38443911cb1b76f4bd93d6c /gcc/df-scan.c
parentafff72577d338d0202f923b9d0d94530c282b2a3 (diff)
PR target/41246
* target.h (struct gcc_target): Add asm_out.trampoline_template, calls.static_chain, calls.trampoline_init, calls.trampoline_adjust_address. * target-def.h (TARGET_ASM_TRAMPOLINE_TEMPLATE): New. (TARGET_STATIC_CHAIN, TARGET_TRAMPOLINE_INIT): New. (TARGET_TRAMPOLINE_ADJUST_ADDRESS): New. * builtins.c (expand_builtin_setjmp_receiver): Use targetm.calls.static_chain; only clobber registers. (expand_builtin_init_trampoline): Use targetm.calls.trampoline_init; set up memory attributes properly for the trampoline block. (expand_builtin_adjust_trampoline): Use targetm.calls.trampoline_adjust_address. * calls.c (prepare_call_address): Add fndecl argument. Use targetm.calls.static_chain. * df-scan.c (df_need_static_chain_reg): Remove. (df_get_entry_block_def_set): Use targetm.calls.static_chain; consolodate static chain handling. * doc/tm.texi: Document new hooks. * emit-rtl.c (static_chain_rtx, static_chain_incoming_rtx): Remove. (init_emit_regs): Don't initialize them. * expr.h (prepare_call_address): Update decl. * final.c (profile_function): Use targetm.calls.static_chain. * function.c (expand_function_start): Likewise. * rtl.h (static_chain_rtx, static_chain_incoming_rtx): Remove. * stmt.c (expand_nl_goto_receiver): Use targetm.calls.static_chain; only clobber registers. * targhooks.c (default_static_chain): New. (default_asm_trampoline_template, default_trampoline_init): New. (default_trampoline_adjust_address): New. * targhooks.h: Declare them. * varasm.c (assemble_trampoline_template): Use targetm.asm_out.trampoline_template. Make the memory block const and set its size. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151983 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/df-scan.c')
-rw-r--r--gcc/df-scan.c44
1 files changed, 6 insertions, 38 deletions
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 35be03c7629..45df29ecc2b 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -3601,18 +3601,6 @@ df_recompute_luids (basic_block bb)
}
-/* Returns true if the function entry needs to
- define the static chain register. */
-
-static bool
-df_need_static_chain_reg (struct function *fun)
-{
- tree fun_context = decl_function_context (fun->decl);
- return fun_context
- && DECL_NO_STATIC_CHAIN (fun_context) == false;
-}
-
-
/* Collect all artificial refs at the block level for BB and add them
to COLLECTION_REC. */
@@ -3891,24 +3879,17 @@ df_get_entry_block_def_set (bitmap entry_block_defs)
if ((call_used_regs[i] == 0) && (df_regs_ever_live_p (i)))
bitmap_set_bit (entry_block_defs, i);
}
- else
- {
- /* If STATIC_CHAIN_INCOMING_REGNUM == STATIC_CHAIN_REGNUM
- only STATIC_CHAIN_REGNUM is defined. If they are different,
- we only care about the STATIC_CHAIN_INCOMING_REGNUM. */
-#ifdef STATIC_CHAIN_INCOMING_REGNUM
- bitmap_set_bit (entry_block_defs, STATIC_CHAIN_INCOMING_REGNUM);
-#else
-#ifdef STATIC_CHAIN_REGNUM
- bitmap_set_bit (entry_block_defs, STATIC_CHAIN_REGNUM);
-#endif
-#endif
- }
r = targetm.calls.struct_value_rtx (current_function_decl, true);
if (r && REG_P (r))
bitmap_set_bit (entry_block_defs, REGNO (r));
+ /* If the function has an incoming STATIC_CHAIN, it has to show up
+ in the entry def set. */
+ r = targetm.calls.static_chain (current_function_decl, true);
+ if (r && REG_P (r))
+ bitmap_set_bit (entry_block_defs, REGNO (r));
+
if ((!reload_completed) || frame_pointer_needed)
{
/* Any reference to any pseudo before reload is a potential
@@ -3946,19 +3927,6 @@ df_get_entry_block_def_set (bitmap entry_block_defs)
#endif
targetm.live_on_entry (entry_block_defs);
-
- /* If the function has an incoming STATIC_CHAIN,
- it has to show up in the entry def set. */
- if (df_need_static_chain_reg (cfun))
- {
-#ifdef STATIC_CHAIN_INCOMING_REGNUM
- bitmap_set_bit (entry_block_defs, STATIC_CHAIN_INCOMING_REGNUM);
-#else
-#ifdef STATIC_CHAIN_REGNUM
- bitmap_set_bit (entry_block_defs, STATIC_CHAIN_REGNUM);
-#endif
-#endif
- }
}