tree-cfg.c (move_block_to_fn): Release bb from dominance info.
authorZdenek Dvorak <dvorakz@suse.cz>
Sat, 28 Apr 2007 08:00:44 +0000 (10:00 +0200)
committerZdenek Dvorak <rakdver@gcc.gnu.org>
Sat, 28 Apr 2007 08:00:44 +0000 (08:00 +0000)
* tree-cfg.c (move_block_to_fn): Release bb from dominance
info.  Update last_basic_block correctly.

From-SVN: r124257

gcc/ChangeLog
gcc/tree-cfg.c

index bd61b8ee3445efaa93350a5d9e06d285eb36443a..8240b2ac234569fb376cea7a47c96943202cc320 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-28  Zdenek Dvorak  <dvorakz@suse.cz>
+
+       * tree-cfg.c (move_block_to_fn): Release bb from dominance
+       info.  Update last_basic_block correctly.
+
 2007-04-27  Kaz Kojima  <kkojima@gcc.gnu.org>
 
        PR target/31701
 2007-04-27  Kaz Kojima  <kkojima@gcc.gnu.org>
 
        PR target/31701
index 59e1cc3b7ab80d1035e0563a10590a01ebec97dd..89339bc9a61ea7ebffda6588a788d8a2637afb3c 100644 (file)
@@ -4571,6 +4571,9 @@ move_block_to_fn (struct function *dest_cfun, basic_block bb,
   struct move_stmt_d d;
   unsigned old_len, new_len;
 
   struct move_stmt_d d;
   unsigned old_len, new_len;
 
+  /* Remove BB from dominance structures.  */
+  delete_from_dominance_info (CDI_DOMINATORS, bb);
+
   /* Link BB to the new linked list.  */
   move_block_after (bb, after);
 
   /* Link BB to the new linked list.  */
   move_block_after (bb, after);
 
@@ -4589,8 +4592,8 @@ move_block_to_fn (struct function *dest_cfun, basic_block bb,
   /* Grow DEST_CFUN's basic block array if needed.  */
   cfg = dest_cfun->cfg;
   cfg->x_n_basic_blocks++;
   /* Grow DEST_CFUN's basic block array if needed.  */
   cfg = dest_cfun->cfg;
   cfg->x_n_basic_blocks++;
-  if (bb->index > cfg->x_last_basic_block)
-    cfg->x_last_basic_block = bb->index;
+  if (bb->index >= cfg->x_last_basic_block)
+    cfg->x_last_basic_block = bb->index + 1;
 
   old_len = VEC_length (basic_block, cfg->x_basic_block_info);
   if ((unsigned) cfg->x_last_basic_block >= old_len)
 
   old_len = VEC_length (basic_block, cfg->x_basic_block_info);
   if ((unsigned) cfg->x_last_basic_block >= old_len)