+2009-11-27 Michael Matz <matz@suse.de>
+
+ PR rtl-optimization/42084
+ * cfgexpand.c (maybe_cleanup_end_of_block): Add new parameter,
+ use it to stop walking.
+ (expand_gimple_cond): Adjust call to above.
+
2009-11-27 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR target/41810
/* A subroutine of expand_gimple_cond. Given E, a fallthrough edge
of a basic block where we just expanded the conditional at the end,
- possibly clean up the CFG and instruction sequence. */
+ possibly clean up the CFG and instruction sequence. LAST is the
+ last instruction before the just emitted jump sequence. */
static void
-maybe_cleanup_end_of_block (edge e)
+maybe_cleanup_end_of_block (edge e, rtx last)
{
/* Special case: when jumpif decides that the condition is
trivial it emits an unconditional jump (and the necessary
normally isn't there in a cleaned CFG), fix it here. */
if (BARRIER_P (get_last_insn ()))
{
- basic_block bb = e->src;
rtx insn;
remove_edge (e);
/* Now, we have a single successor block, if we have insns to
/* Make sure we have an unconditional jump. Otherwise we're
confused. */
gcc_assert (JUMP_P (insn) && !any_condjump_p (insn));
- for (insn = PREV_INSN (insn); insn != BB_HEAD (bb);)
+ for (insn = PREV_INSN (insn); insn != last;)
{
insn = PREV_INSN (insn);
if (JUMP_P (NEXT_INSN (insn)))
}
true_edge->goto_block = NULL;
false_edge->flags |= EDGE_FALLTHRU;
- maybe_cleanup_end_of_block (false_edge);
+ maybe_cleanup_end_of_block (false_edge, last);
return NULL;
}
if (true_edge->dest == bb->next_bb)
}
false_edge->goto_block = NULL;
true_edge->flags |= EDGE_FALLTHRU;
- maybe_cleanup_end_of_block (true_edge);
+ maybe_cleanup_end_of_block (true_edge, last);
return NULL;
}