final.c (final): Do not abort when reg-stack introduces a new insn.
authorRichard Henderson <rth@cygnus.com>
Sat, 8 Jul 2000 21:17:51 +0000 (14:17 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 8 Jul 2000 21:17:51 +0000 (14:17 -0700)
        * final.c (final): Do not abort when reg-stack introduces
        a new insn.

From-SVN: r34927

gcc/ChangeLog
gcc/final.c

index 67eb6fc952182a108bc8fab1945b3bffedbe58a3..7bc499e2461cf903278d3a9cee8f8722267bdca4 100644 (file)
@@ -1,3 +1,8 @@
+2000-07-08  Richard Henderson  <rth@cygnus.com>
+
+        * final.c (final): Do not abort when reg-stack introduces
+       a new insn.
+
 2000-07-08  Zack Weinberg  <zack@wolery.cumb.org>
 
        * cpplib.h (struct cpp_name): Now struct cpp_string.
index 3537bcf431a23b82cac4591c5dc13b30d0b71c94..be4a01e0bc3e9746d7969b220dd77f3fc357095f 100644 (file)
@@ -2014,14 +2014,23 @@ final (first, file, optimize, prescan)
   for (insn = NEXT_INSN (first); insn;)
     {
 #ifdef HAVE_ATTR_length
-#ifdef ENABLE_CHECKING
-      /* This can be triggered by bugs elsewhere in the compiler if
-        new insns are created after init_insn_lengths is called.  */
       if (INSN_UID (insn) >= insn_lengths_max_uid)
-       abort ();
-#endif
-      insn_current_address = insn_addresses[INSN_UID (insn)];
+       {
+#ifdef STACK_REGS
+         /* Irritatingly, the reg-stack pass is creating new instructions
+            and because of REG_DEAD note abuse it has to run after
+            shorten_branches.  Fake address of -1 then.  */
+         insn_current_address = -1;
+#else
+         /* This can be triggered by bugs elsewhere in the compiler if
+            new insns are created after init_insn_lengths is called.  */
+         abort ();
 #endif
+       }
+      else
+       insn_current_address = insn_addresses[INSN_UID (insn)];
+#endif /* HAVE_ATTR_length */
+
       insn = final_scan_insn (insn, file, optimize, prescan, 0);
     }