cfg_layout_merge_blocks (basic_block a, basic_block b)
{
bool forwarder_p = (b->flags & BB_FORWARDER_BLOCK) != 0;
+ rtx insn;
gcc_checking_assert (cfg_layout_can_merge_blocks_p (a, b));
/* In the case basic blocks are not adjacent, move them around. */
if (NEXT_INSN (BB_END (a)) != BB_HEAD (b))
{
- rtx first = unlink_insn_chain (BB_HEAD (b), BB_END (b));
-
- emit_insn_after_noloc (first, BB_END (a), a);
- /* Skip possible DELETED_LABEL insn. */
- if (!NOTE_INSN_BASIC_BLOCK_P (first))
- first = NEXT_INSN (first);
- gcc_assert (NOTE_INSN_BASIC_BLOCK_P (first));
- BB_HEAD (b) = NULL;
-
- /* emit_insn_after_noloc doesn't call df_insn_change_bb.
- We need to explicitly call. */
- update_bb_for_insn_chain (NEXT_INSN (first),
- BB_END (b),
- a);
+ insn = unlink_insn_chain (BB_HEAD (b), BB_END (b));
- delete_insn (first);
+ emit_insn_after_noloc (insn, BB_END (a), a);
}
/* Otherwise just re-associate the instructions. */
else
{
- rtx insn;
-
- update_bb_for_insn_chain (BB_HEAD (b), BB_END (b), a);
-
insn = BB_HEAD (b);
- /* Skip possible DELETED_LABEL insn. */
- if (!NOTE_INSN_BASIC_BLOCK_P (insn))
- insn = NEXT_INSN (insn);
- gcc_assert (NOTE_INSN_BASIC_BLOCK_P (insn));
- BB_HEAD (b) = NULL;
BB_END (a) = BB_END (b);
- delete_insn (insn);
}
+ /* emit_insn_after_noloc doesn't call df_insn_change_bb.
+ We need to explicitly call. */
+ update_bb_for_insn_chain (insn, BB_END (b), a);
+
+ /* Skip possible DELETED_LABEL insn. */
+ if (!NOTE_INSN_BASIC_BLOCK_P (insn))
+ insn = NEXT_INSN (insn);
+ gcc_assert (NOTE_INSN_BASIC_BLOCK_P (insn));
+ BB_HEAD (b) = NULL;
+ delete_insn (insn);
+
df_bb_delete (b->index);
/* Possible tablejumps and barriers should appear after the block. */