summaryrefslogtreecommitdiff
path: root/gcc/df-scan.c
diff options
context:
space:
mode:
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
- }
}