(add_labels_and_missing_jumps): ... here.
(fix_up_fall_thru_edges, fix_crossing_conditional_branches): Use it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176416
138bc75d-0d04-0410-961f-
82ee72b054a4
+2011-07-18 Richard Henderson <rth@redhat.com>
+
+ * bb-reorder.c (emit_barrier_after_bb): Split out of ...
+ (add_labels_and_missing_jumps): ... here.
+ (fix_up_fall_thru_edges, fix_crossing_conditional_branches): Use it.
+
2011-07-18 Uros Bizjak <ubizjak@gmail.com>
PR target/47744
2011-07-18 Uros Bizjak <ubizjak@gmail.com>
PR target/47744
+/* Emit a barrier into the footer of BB. */
+
+static void
+emit_barrier_after_bb (basic_block bb)
+{
+ rtx barrier = emit_barrier_after (BB_END (bb));
+ bb->il.rtl->footer = unlink_insn_chain (barrier, barrier);
+}
+
/* If any destination of a crossing edge does not have a label, add label;
Convert any easy fall-through crossing edges to unconditional jumps. */
/* If any destination of a crossing edge does not have a label, add label;
Convert any easy fall-through crossing edges to unconditional jumps. */
{
basic_block src = e->src;
basic_block dest = e->dest;
{
basic_block src = e->src;
basic_block dest = e->dest;
- rtx label, barrier, new_jump;
if (dest == EXIT_BLOCK_PTR)
continue;
if (dest == EXIT_BLOCK_PTR)
continue;
new_jump = emit_jump_insn_after (gen_jump (label), BB_END (src));
BB_END (src) = new_jump;
new_jump = emit_jump_insn_after (gen_jump (label), BB_END (src));
BB_END (src) = new_jump;
- barrier = emit_barrier_after (new_jump);
JUMP_LABEL (new_jump) = label;
LABEL_NUSES (label) += 1;
JUMP_LABEL (new_jump) = label;
LABEL_NUSES (label) += 1;
- src->il.rtl->footer = unlink_insn_chain (barrier, barrier);
+
+ emit_barrier_after_bb (src);
/* Mark edge as non-fallthru. */
e->flags &= ~EDGE_FALLTHRU;
/* Mark edge as non-fallthru. */
e->flags &= ~EDGE_FALLTHRU;
int invert_worked;
rtx old_jump;
rtx fall_thru_label;
int invert_worked;
rtx old_jump;
rtx fall_thru_label;
}
/* Add barrier after new jump */
}
/* Add barrier after new jump */
-
- if (new_bb)
- {
- barrier = emit_barrier_after (BB_END (new_bb));
- new_bb->il.rtl->footer = unlink_insn_chain (barrier,
- barrier);
- }
- else
- {
- barrier = emit_barrier_after (BB_END (cur_bb));
- cur_bb->il.rtl->footer = unlink_insn_chain (barrier,
- barrier);
- }
+ emit_barrier_after_bb (new_bb ? new_bb : cur_bb);
rtx old_label = NULL_RTX;
rtx new_label;
rtx new_jump;
rtx old_label = NULL_RTX;
rtx new_label;
rtx new_jump;
last_bb = EXIT_BLOCK_PTR->prev_bb;
last_bb = EXIT_BLOCK_PTR->prev_bb;
new_jump = emit_jump_insn_after (gen_return (),
BB_END (new_bb));
}
new_jump = emit_jump_insn_after (gen_return (),
BB_END (new_bb));
}
-
- barrier = emit_barrier_after (new_jump);
JUMP_LABEL (new_jump) = old_label;
JUMP_LABEL (new_jump) = old_label;
- new_bb->il.rtl->footer = unlink_insn_chain (barrier,
- barrier);
+ BB_END (new_bb) = new_jump;
+
+ emit_barrier_after_bb (new_bb);
/* Make sure new bb is in same partition as source
of conditional branch. */
/* Make sure new bb is in same partition as source
of conditional branch. */