Commit f9df6f16 by Jakub Jelinek Committed by Jakub Jelinek

* cfgrtl.c (cfg_layout_merge_blocks): Cleanup.

From-SVN: r184925
parent 45c0175b
2012-03-05 Jakub Jelinek <jakub@redhat.com>
* cfgrtl.c (cfg_layout_merge_blocks): Cleanup.
2012-03-05 Richard Guenther <rguenther@suse.de> 2012-03-05 Richard Guenther <rguenther@suse.de>
* tree.c (integer_zerop): Handle VECTOR_CSTs. * tree.c (integer_zerop): Handle VECTOR_CSTs.
......
...@@ -2818,6 +2818,7 @@ static void ...@@ -2818,6 +2818,7 @@ static void
cfg_layout_merge_blocks (basic_block a, basic_block b) cfg_layout_merge_blocks (basic_block a, basic_block b)
{ {
bool forwarder_p = (b->flags & BB_FORWARDER_BLOCK) != 0; bool forwarder_p = (b->flags & BB_FORWARDER_BLOCK) != 0;
rtx insn;
gcc_checking_assert (cfg_layout_can_merge_blocks_p (a, b)); gcc_checking_assert (cfg_layout_can_merge_blocks_p (a, b));
...@@ -2883,40 +2884,28 @@ cfg_layout_merge_blocks (basic_block a, basic_block b) ...@@ -2883,40 +2884,28 @@ cfg_layout_merge_blocks (basic_block a, basic_block b)
/* In the case basic blocks are not adjacent, move them around. */ /* In the case basic blocks are not adjacent, move them around. */
if (NEXT_INSN (BB_END (a)) != BB_HEAD (b)) if (NEXT_INSN (BB_END (a)) != BB_HEAD (b))
{ {
rtx first = unlink_insn_chain (BB_HEAD (b), BB_END (b)); insn = 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);
delete_insn (first); emit_insn_after_noloc (insn, BB_END (a), a);
} }
/* Otherwise just re-associate the instructions. */ /* Otherwise just re-associate the instructions. */
else else
{ {
rtx insn;
update_bb_for_insn_chain (BB_HEAD (b), BB_END (b), a);
insn = BB_HEAD (b); 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); 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); df_bb_delete (b->index);
/* Possible tablejumps and barriers should appear after the block. */ /* Possible tablejumps and barriers should appear after the block. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment