@@ -2502,6 +2502,7 @@ extern int sibcall_epilogue_contains (co
extern void mark_temp_addr_taken (rtx);
extern void update_temp_slot_address (rtx, rtx);
extern void maybe_copy_prologue_epilogue_insn (rtx, rtx);
+extern void set_return_jump_label (rtx);
/* In stmt.c */
extern void expand_null_return (void);
@@ -5395,6 +5395,20 @@ emit_return_into_block (bool simple_p, b
}
#endif
+/* Set JUMP_LABEL for a return insn. */
+
+void
+set_return_jump_label (rtx returnjump)
+{
+ rtx pat = PATTERN (returnjump);
+ if (GET_CODE (pat) == PARALLEL)
+ pat = XVECEXP (pat, 0, 0);
+ if (ANY_RETURN_P (pat))
+ JUMP_LABEL (returnjump) = pat;
+ else
+ JUMP_LABEL (returnjump) = ret_rtx;
+}
+
/* Generate the prologue and epilogue RTL if the machine supports it. Thread
this into place with notes indicating where the prologue ends and where
the epilogue begins. Update the basic block information when possible.
@@ -5883,7 +5897,7 @@ thread_prologue_and_epilogue_insns (void
emit_return_into_block (false, last_bb);
epilogue_end = BB_END (last_bb);
if (JUMP_P (epilogue_end))
- JUMP_LABEL (epilogue_end) = ret_rtx;
+ set_return_jump_label (epilogue_end);
single_succ_edge (last_bb)->flags &= ~EDGE_FALLTHRU;
goto epilogue_done;
}
@@ -5948,15 +5962,7 @@ thread_prologue_and_epilogue_insns (void
inserted = true;
if (JUMP_P (returnjump))
- {
- rtx pat = PATTERN (returnjump);
- if (GET_CODE (pat) == PARALLEL)
- pat = XVECEXP (pat, 0, 0);
- if (ANY_RETURN_P (pat))
- JUMP_LABEL (returnjump) = pat;
- else
- JUMP_LABEL (returnjump) = ret_rtx;
- }
+ set_return_jump_label (returnjump);
}
else
#endif
@@ -1273,7 +1273,7 @@ force_nonfallthru_and_redirect (edge e,
gcc_unreachable ();
#endif
}
- JUMP_LABEL (BB_END (jump_block)) = jump_label;
+ set_return_jump_label (BB_END (jump_block));
}
else
{
@@ -467,7 +467,7 @@ find_end_label (rtx kind)
/* The return we make may have delay slots too. */
rtx insn = gen_return ();
insn = emit_jump_insn (insn);
- JUMP_LABEL (insn) = ret_rtx;
+ set_return_jump_label (insn);
emit_barrier ();
if (num_delay_slots (insn) > 0)
obstack_ptr_grow (&unfilled_slots_obstack, insn);