global.c (build_insn_chain): Verify no real insns exist past the end of the last...
authorJeffrey A Law <law@cygnus.com>
Fri, 9 Oct 1998 13:28:55 +0000 (13:28 +0000)
committerJeff Law <law@gcc.gnu.org>
Fri, 9 Oct 1998 13:28:55 +0000 (07:28 -0600)
        * global.c (build_insn_chain): Verify no real insns exist past the
        end of the last basic block, then exit the loop.

From-SVN: r22961

gcc/ChangeLog
gcc/global.c

index 57bf533207d164702cddc73cb904cb44b0184f44..436cd1d33a27962d5851ad9b7c51c619e061038b 100644 (file)
@@ -1,3 +1,8 @@
+Fri Oct  9 14:26:44 1998  Jeffrey A Law  (law@cygnus.com)
+
+       * global.c (build_insn_chain): Verify no real insns exist past the
+       end of the last basic block, then exit the loop.
+
 Fri Oct  9 11:44:47 1998  David Edelsohn  <edelsohn@mhpcc.edu>
 
        * loop.c (insert_bct): Ensure loop_iteration_var non-zero before use.
index 0bacc2381722a6197fedfa13c5e59d8e0854faad..af27ea0dc840a767cf311e493df7b06332b75ae3 100644 (file)
@@ -1722,6 +1722,20 @@ build_insn_chain (first)
 
       if (first == basic_block_end[b])
        b++;
+
+      /* Stop after we pass the end of the last basic block.  Verify that
+        no real insns are after the end of the last basic block.
+
+        We may want to reorganize the loop somewhat since this test should
+        always be the right exit test.  */
+      if (b == n_basic_blocks)
+       {
+         for (first = NEXT_INSN (first) ; first; first = NEXT_INSN (first))
+           if (GET_RTX_CLASS (GET_CODE (first)) == 'i'
+               && GET_CODE (PATTERN (first)) != USE)
+             abort ();
+         break;
+       }
     }
   FREE_REG_SET (live_relevant_regs);
   *p = 0;