bb-reorder.c (reorder_basic_blocks): Update PREV_INSN as well as NEXT_INSN.
authorJason Eckhardt <jle@cygnus.com>
Sat, 18 Mar 2000 20:40:38 +0000 (20:40 +0000)
committerJason Eckhardt <jle@gcc.gnu.org>
Sat, 18 Mar 2000 20:40:38 +0000 (20:40 +0000)
* bb-reorder.c (reorder_basic_blocks): Update PREV_INSN as well as
NEXT_INSN. Update last insn in chain.

From-SVN: r32623

gcc/ChangeLog
gcc/bb-reorder.c

index fe618c63f60ba2542d54310f5fc4e1be26ee1bea..50cc97f8376fdb29e385de602e73dafacdb038b1 100644 (file)
@@ -1,3 +1,8 @@
+Sat Mar 18 14:38:00 2000  Jason Eckhardt  <jle@cygnus.com>
+
+       * bb-reorder.c (reorder_basic_blocks): Update PREV_INSN as well as
+       NEXT_INSN. Update last insn in chain.
+
 2000-03-17  Jason Merrill  <jason@casey.cygnus.com>
 
        * dwarf2out.c (dwarf2out_decl): Don't emit anything for types
index 0adf68324d1ef57bc70384e7f5c7b96e7b63e045..f63483d01cebdde11451adc10df3e5df85866ac2 100644 (file)
@@ -765,7 +765,17 @@ reorder_basic_blocks ()
       rtx xafter = skip_insns_between_block (BASIC_BLOCK (n_basic_blocks - 1),
                                             REORDER_SKIP_AFTER);
       if (xafter)
-       NEXT_INSN (xafter) = last_insn;
+       {
+         NEXT_INSN (xafter) = last_insn;
+         if (last_insn)
+           {
+             rtx x = last_insn;
+             PREV_INSN (last_insn) = xafter;
+             while (NEXT_INSN (x))
+               x = NEXT_INSN (x);
+             set_last_insn (x);
+           }
+       }
       else
        abort();
     }