]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* jump.c (delete_insn): Delete the addr_vec when deleting a tablejump.
authorRichard Henderson <rth@cygnus.com>
Wed, 4 Aug 1999 08:16:46 +0000 (01:16 -0700)
committerJeff Law <law@gcc.gnu.org>
Wed, 4 Aug 1999 08:16:46 +0000 (02:16 -0600)
From-SVN: r28491

gcc/ChangeLog
gcc/jump.c

index 88032f8623ce4699bce7fc8225642cf16fbd0bbe..4f18aab798b18cf6e6418a2dba4e50bfb19bb6f0 100644 (file)
@@ -1,3 +1,7 @@
+Wed Aug  4 02:15:32 1999  Richard Henderson <rth@cygnus.com>
+
+       * jump.c (delete_insn): Delete the addr_vec when deleting a tablejump.
+
 Wed Aug  4 01:08:44 1999  Jeffrey A Law  (law@cygnus.com)
 
         * flow.c (delete_unreachable_blocks): Do not call merge_blocks
index 6b6a90ae3a94c92ccfbddf64532d4d7a0c285cfd..e24adb26e2309fcd7b108db34a2b3f31e1e35d37 100644 (file)
@@ -3998,20 +3998,36 @@ delete_insn (insn)
      and delete the label if it is now unused.  */
 
   if (GET_CODE (insn) == JUMP_INSN && JUMP_LABEL (insn))
-    if (--LABEL_NUSES (JUMP_LABEL (insn)) == 0)
-      {
-       /* This can delete NEXT or PREV,
-          either directly if NEXT is JUMP_LABEL (INSN),
-          or indirectly through more levels of jumps.  */
-       delete_insn (JUMP_LABEL (insn));
-       /* I feel a little doubtful about this loop,
-          but I see no clean and sure alternative way
-          to find the first insn after INSN that is not now deleted.
-          I hope this works.  */
-       while (next && INSN_DELETED_P (next))
-         next = NEXT_INSN (next);
-       return next;
-      }
+    {
+      rtx lab = JUMP_LABEL (insn), lab_next;
+
+      if (--LABEL_NUSES (lab) == 0)
+       {
+         /* This can delete NEXT or PREV,
+            either directly if NEXT is JUMP_LABEL (INSN),
+            or indirectly through more levels of jumps.  */
+         delete_insn (lab);
+
+         /* I feel a little doubtful about this loop,
+            but I see no clean and sure alternative way
+            to find the first insn after INSN that is not now deleted.
+            I hope this works.  */
+         while (next && INSN_DELETED_P (next))
+           next = NEXT_INSN (next);
+         return next;
+       }
+      else if ((lab_next = next_nonnote_insn (lab)) != NULL
+              && GET_CODE (lab_next) == JUMP_INSN
+              && (GET_CODE (PATTERN (lab_next)) == ADDR_VEC
+                  || GET_CODE (PATTERN (lab_next)) == ADDR_DIFF_VEC))
+       {
+         /* If we're deleting the tablejump, delete the dispatch table.
+            We may not be able to kill the label immediately preceeding
+            just yet, as it might be referenced in code leading up to
+            the tablejump.  */
+         delete_insn (lab_next);
+       }
+    }
 
   /* Likewise if we're deleting a dispatch table.  */