cfgrtl.c (delete_insn): Check for not NOTE_INSN_DELETED_LABEL before decrementing...
authorRichard Henderson <rth@gcc.gnu.org>
Mon, 31 Dec 2001 21:33:19 +0000 (13:33 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 31 Dec 2001 21:33:19 +0000 (13:33 -0800)
        * cfgrtl.c (delete_insn): Check for not NOTE_INSN_DELETED_LABEL
        before decrementing LABEL_NUSES from a jump table.

From-SVN: r48431

gcc/cfgrtl.c

index e7e6e699accbc277b4d02ba34ad8c06d2456f439..56b3bf28e6a2473039bb18b837656a172da7e734 100644 (file)
@@ -161,7 +161,15 @@ delete_insn (insn)
       int i;
 
       for (i = 0; i < len; i++)
-       LABEL_NUSES (XEXP (XVECEXP (pat, diff_vec_p, i), 0))--;
+       {
+         rtx label = XEXP (XVECEXP (pat, diff_vec_p, i), 0);
+
+         /* When deleting code in bulk (e.g. removing many unreachable
+            blocks) we can delete a label that's a target of the vector
+            before deleting the vector itself.  */
+         if (GET_CODE (label) != NOTE)
+           LABEL_NUSES (label)--;
+       }
     }
 
   return next;