From f9df6f16c70c51b09e68ceba001ec5671ee8adcf Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 5 Mar 2012 12:53:01 +0100 Subject: * cfgrtl.c (cfg_layout_merge_blocks): Cleanup. From-SVN: r184925 --- gcc/cfgrtl.c | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) (limited to 'gcc/cfgrtl.c') diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 8283da0..b86cc74 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -2818,6 +2818,7 @@ static void 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)); @@ -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. */ 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. */ -- cgit v1.1