------- Comment #13 from spark at gcc dot gnu dot org  2007-11-21 22:08 -------
The following patch seems to fix the problem:

diff -r fad6feb87420 gcc/cfgrtl.c
--- a/gcc/cfgrtl.c      Wed Nov 21 00:17:50 2007 +0000
+++ b/gcc/cfgrtl.c      Wed Nov 21 14:07:15 2007 -0800
@@ -2629,6 +2629,7 @@ cfg_layout_merge_blocks (basic_block a,
   /* In the case basic blocks are not adjacent, move them around.  */
   if (NEXT_INSN (BB_END (a)) != BB_HEAD (b))
     {
+      rtx insn;
       rtx first = unlink_insn_chain (BB_HEAD (b), BB_END (b));

       emit_insn_after_noloc (first, BB_END (a), a);
@@ -2637,7 +2638,15 @@ cfg_layout_merge_blocks (basic_block a,
        first = NEXT_INSN (first);
       gcc_assert (NOTE_INSN_BASIC_BLOCK_P (first));
       BB_HEAD (b) = NULL;
+      insn = NEXT_INSN (first);
       delete_insn (first);
+
+      for (; insn != NEXT_INSN (BB_END (b));
+          insn = NEXT_INSN (insn))
+       {
+         set_block_for_insn (insn, a);
+         df_insn_change_bb (insn);
+       }
     }
   /* Otherwise just re-associate the instructions.  */
   else


I'm going to stare at the surrounding code a bit more 
to convince myself, and will do some testing.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34171

Reply via email to