stream. */
static bool
-rtl_redirect_edge_and_branch (e, target)
- edge e;
- basic_block target;
+rtl_redirect_edge_and_branch (edge e, basic_block target)
{
if (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH))
return false;
{
/* Create the new structures. */
+ /* If the old block ended with a tablejump, skip its table
+ by searching forward from there. Otherwise start searching
+ forward from the last instruction of the old block. */
+ if (!tablejump_p (e->src->end, NULL, ¬e))
+ note = e->src->end;
+
/* Position the new block correctly relative to loop notes. */
- note = last_loop_beg_note (e->src->end);
+ note = last_loop_beg_note (note);
note = NEXT_INSN (note);
- /* ... and ADDR_VECs. */
- if (note != NULL
- && GET_CODE (note) == CODE_LABEL
- && NEXT_INSN (note)
- && GET_CODE (NEXT_INSN (note)) == JUMP_INSN
- && (GET_CODE (PATTERN (NEXT_INSN (note))) == ADDR_DIFF_VEC
- || GET_CODE (PATTERN (NEXT_INSN (note))) == ADDR_VEC))
- note = NEXT_INSN (NEXT_INSN (note));
-
jump_block = create_basic_block (note, NULL, e->src);
jump_block->count = e->count;
jump_block->frequency = EDGE_FREQUENCY (e);
if (e->flags & EDGE_FALLTHRU)
n_fallthru++, fallthru = e;
- if ((e->flags & ~(EDGE_DFS_BACK | EDGE_CAN_FALLTHRU | EDGE_IRREDUCIBLE_LOOP)) == 0)
+ if ((e->flags & ~(EDGE_DFS_BACK
+ | EDGE_CAN_FALLTHRU
+ | EDGE_IRREDUCIBLE_LOOP
+ | EDGE_LOOP_EXIT)) == 0)
n_branch++;
if (e->flags & EDGE_ABNORMAL_CALL)