if (label == tmp)
return true;
- if (tmp != NULL_RTX
- && (tmp = NEXT_INSN (tmp)) != NULL_RTX
- && GET_CODE (tmp) == JUMP_INSN
- && (tmp = PATTERN (tmp),
- GET_CODE (tmp) == ADDR_VEC
- || GET_CODE (tmp) == ADDR_DIFF_VEC))
+ if (tablejump_p (jump_insn, NULL, &tmp))
{
rtvec vec = XVEC (tmp, GET_CODE (tmp) == ADDR_DIFF_VEC);
int i, veclen = GET_NUM_ELEM (vec);
b_has_incoming_fallthru = (tmp_edge != NULL);
b_fallthru_edge = tmp_edge;
next = b->prev_bb;
+ if (next == c)
+ next = next->prev_bb;
/* Otherwise, we're going to try to move C after B. If C does
not have an outgoing fallthru, then it can be moved
return next == ENTRY_BLOCK_PTR ? next->next_bb : next;
}
- return false;
+ return NULL;
}
\f
#endif
if (reload_completed
- ? ! rtx_renumbered_equal_p (p1, p2) : ! rtx_equal_p (p1, p2))
+ ? rtx_renumbered_equal_p (p1, p2) : rtx_equal_p (p1, p2))
+ return true;
+
+ /* Do not do EQUIV substitution after reload. First, we're undoing the
+ work of reload_cse. Second, we may be undoing the work of the post-
+ reload splitting pass. */
+ /* ??? Possibly add a new phase switch variable that can be used by
+ targets to disallow the troublesome insns after splitting. */
+ if (!reload_completed)
{
/* The following code helps take care of G++ cleanups. */
rtx equiv1 = find_reg_equal_equiv_note (i1);
return true;
}
}
-
- return false;
}
- return true;
+ return false;
}
\f
/* Look through the insns at the end of BB1 and BB2 and find the longest
while (true)
{
/* Ignore notes. */
- while (!active_insn_p (i1) && i1 != bb1->head)
+ while (!INSN_P (i1) && i1 != bb1->head)
i1 = PREV_INSN (i1);
- while (!active_insn_p (i2) && i2 != bb2->head)
+ while (!INSN_P (i2) && i2 != bb2->head)
i2 = PREV_INSN (i2);
if (i1 == bb1->head || i2 == bb2->head)
if (!insns_match_p (mode, i1, i2))
break;
- /* Don't begin a cross-jump with a USE or CLOBBER insn. */
- if (active_insn_p (i1))
+ /* Don't begin a cross-jump with a NOTE insn. */
+ if (INSN_P (i1))
{
/* If the merged insns have different REG_EQUAL notes, then
remove them. */
Two, it keeps line number notes as matched as may be. */
if (ninsns)
{
- while (last1 != bb1->head && !active_insn_p (PREV_INSN (last1)))
+ while (last1 != bb1->head && !INSN_P (PREV_INSN (last1)))
last1 = PREV_INSN (last1);
if (last1 != bb1->head && GET_CODE (PREV_INSN (last1)) == CODE_LABEL)
last1 = PREV_INSN (last1);
- while (last2 != bb2->head && !active_insn_p (PREV_INSN (last2)))
+ while (last2 != bb2->head && !INSN_P (PREV_INSN (last2)))
last2 = PREV_INSN (last2);
if (last2 != bb2->head && GET_CODE (PREV_INSN (last2)) == CODE_LABEL)
the jump tables are same too. So disable crossjumping of blocks BB1
and BB2 because when deleting the common insns in the end of BB1
by flow_delete_block () the jump table would be deleted too. */
- /* If LABEL2 is contained in BB1->END do not do anything
+ /* If LABEL2 is referenced in BB1->END do not do anything
because we would loose information when replacing
LABEL1 by LABEL2 and then LABEL2 by LABEL1 in BB1->END. */
- if (label1 != label2 && !subrtx_p (label2, bb1->end))
+ if (label1 != label2 && !rtx_referenced_p (label2, bb1->end))
{
/* Set IDENTICAL to true when the tables are identical. */
bool identical = false;
if (identical)
{
- rtx_pair rr;
+ replace_label_data rr;
bool match;
/* Temporarily replace references to LABEL1 with LABEL2
in BB1->END so that we could compare the instructions. */
rr.r1 = label1;
rr.r2 = label2;
+ rr.update_label_nuses = false;
for_each_rtx (&bb1->end, replace_label, &rr);
match = insns_match_p (mode, bb1->end, bb2->end);
&& tablejump_p (src2->end, &label2, &table2)
&& label1 != label2)
{
- rtx_pair rr;
+ replace_label_data rr;
rtx insn;
/* Replace references to LABEL1 with LABEL2. */
rr.r1 = label1;
rr.r2 = label2;
+ rr.update_label_nuses = true;
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
/* Do not replace the label in SRC1->END because when deleting
}
}
#endif
-
+
/* Avoid splitting if possible. */
if (newpos2 == src2->head)
redirect_to = src2;
/* If the jump insn has side effects,
we can't kill the edge. */
&& (GET_CODE (b->end) != JUMP_INSN
- || simplejump_p (b->end))
+ || (flow2_completed
+ ? simplejump_p (b->end)
+ : onlyjump_p (b->end)))
&& (next = merge_blocks (s, b, c, mode)))
{
b = next;