* cfgrtl.c (cfg_layout_merge_blocks): Cleanup.
authorJakub Jelinek <jakub@redhat.com>
Mon, 5 Mar 2012 11:53:01 +0000 (12:53 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 5 Mar 2012 11:53:01 +0000 (12:53 +0100)
From-SVN: r184925

gcc/ChangeLog
gcc/cfgrtl.c

index a7736fd..3d22178 100644 (file)
@@ -1,3 +1,7 @@
+2012-03-05  Jakub Jelinek  <jakub@redhat.com>
+
+       * cfgrtl.c (cfg_layout_merge_blocks): Cleanup.
+
 2012-03-05  Richard Guenther  <rguenther@suse.de>
 
        * tree.c (integer_zerop): Handle VECTOR_CSTs.
index 8283da0..b86cc74 100644 (file)
@@ -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.  */