summaryrefslogtreecommitdiff
path: root/gcc/resource.c
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-28 18:45:20 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-28 18:45:20 +0000
commit4115ac36433a184cbfa7154673517e25a02ed27b (patch)
tree05341594c41a09d1c77b0330d5b66b0fcb4a9821 /gcc/resource.c
parent9e08230d540aa4852159cf23da5df2f28bc02525 (diff)
downloadgcc-4115ac36433a184cbfa7154673517e25a02ed27b.tar.gz
* rtlanal.c (tablejump_p): False for returns.
* reorg.c (first_active_target_insn): New static function. (find_end_label): Set JUMP_LABEL for a new returnjump. (optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, get_branch_condition, steal_delay_list_from_target, own_thread_p, fill_simple_delay_slots, follow_jumps, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Adjust to handle ret_rtx in JUMP_LABELs. * jump.c (delete_related_insns): Likewise. (jump_to_label_p): New function. (redirect_target): New static function. (redirect_exp_1): Use it. Adjust to handle ret_rtx in JUMP_LABELS. (redirect_jump_1): Assert that the new label is nonnull. (redirect_jump): Likewise. (redirect_jump_2): Check for ANY_RETURN_P rather than NULL labels. * ifcvt.c (find_if_case_1): Take care when redirecting jumps to the exit block. (dead_or_predicable): Change NEW_DEST arg to DEST_EDGE. All callers changed. Ensure that the right label is passed to redirect_jump. * function.c (emit_return_into_block, thread_prologue_and_epilogue_insns): Ensure new returnjumps have ret_rtx in their JUMP_LABEL. * print-rtl.c (print_rtx): Handle ret_rtx in a JUMP_LABEL. * emit-rtl.c (skip_consecutive_labels): Allow the caller to pass ret_rtx as label. * cfglayout.c (fixup_reorder_chain): Use force_nonfallthru_and_redirect rather than force_nonfallthru. (duplicate_insn_chain): Copy JUMP_LABELs for returns. * rtl.h (ANY_RETURN_P): New macro. (jump_to_label_p): Declare. * resource.c (find_dead_or_set_registers): Handle ret_rtx in JUMP_LABELs. (mark_target_live_regs): Likewise. * basic-block.h (force_nonfallthru_and_redirect): Declare. * cfgrtl.c (force_nonfallthru_and_redirect): No longer static. * config/alpha/alpha.c (alpha_tablejump_addr_vec, alpha_tablejump_best_label): Remove functions. * config/alpha/alpha-protos.c (alpha_tablejump_addr_vec, alpha_tablejump_best_label): Remove declarations. * config/sh/sh.c (barrier_align, split_branches): Adjust for ret_rtx in JUMP_LABELs. * config/arm/arm.c (is_jump_table): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176881 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/resource.c')
-rw-r--r--gcc/resource.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/resource.c b/gcc/resource.c
index 1ee87c017af..83801112113 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -495,6 +495,8 @@ find_dead_or_set_registers (rtx target, struct resources *res,
|| GET_CODE (PATTERN (this_jump_insn)) == RETURN)
{
next = JUMP_LABEL (this_jump_insn);
+ if (ANY_RETURN_P (next))
+ next = NULL_RTX;
if (jump_insn == 0)
{
jump_insn = insn;
@@ -562,9 +564,10 @@ find_dead_or_set_registers (rtx target, struct resources *res,
AND_COMPL_HARD_REG_SET (scratch, needed.regs);
AND_COMPL_HARD_REG_SET (fallthrough_res.regs, scratch);
- find_dead_or_set_registers (JUMP_LABEL (this_jump_insn),
- &target_res, 0, jump_count,
- target_set, needed);
+ if (!ANY_RETURN_P (JUMP_LABEL (this_jump_insn)))
+ find_dead_or_set_registers (JUMP_LABEL (this_jump_insn),
+ &target_res, 0, jump_count,
+ target_set, needed);
find_dead_or_set_registers (next,
&fallthrough_res, 0, jump_count,
set, needed);
@@ -878,7 +881,7 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res)
struct resources set, needed;
/* Handle end of function. */
- if (target == 0)
+ if (target == 0 || ANY_RETURN_P (target))
{
*res = end_of_function_needs;
return;
@@ -1097,8 +1100,9 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res)
struct resources new_resources;
rtx stop_insn = next_active_insn (jump_insn);
- mark_target_live_regs (insns, next_active_insn (jump_target),
- &new_resources);
+ if (!ANY_RETURN_P (jump_target))
+ jump_target = next_active_insn (jump_target);
+ mark_target_live_regs (insns, jump_target, &new_resources);
CLEAR_RESOURCE (&set);
CLEAR_RESOURCE (&needed);