(delete_handlers): When clear LABEL_PRESERVE_P,
authorJim Wilson <wilson@gcc.gnu.org>
Sat, 21 Jan 1995 01:58:34 +0000 (17:58 -0800)
committerJim Wilson <wilson@gcc.gnu.org>
Sat, 21 Jan 1995 01:58:34 +0000 (17:58 -0800)
also remove label from nonlocal_label list.

From-SVN: r8782

gcc/function.c

index 73f59dab4e78c3556ec86f1534105e16f5c9312f..88b346cb6241df0cdd3ff0d621b2f16b0de5d399 100644 (file)
@@ -2957,7 +2957,25 @@ delete_handlers ()
         Also permit deletion of the nonlocal labels themselves
         if nothing local refers to them.  */
       if (GET_CODE (insn) == CODE_LABEL)
-       LABEL_PRESERVE_P (insn) = 0;
+       {
+         tree t, last_t;
+
+         LABEL_PRESERVE_P (insn) = 0;
+
+         /* Remove it from the nonlocal_label list, to avoid confusing
+            flow.  */
+         for (t = nonlocal_labels, last_t = 0; t;
+              last_t = t, t = TREE_CHAIN (t))
+           if (DECL_RTL (TREE_VALUE (t)) == insn)
+             break;
+         if (t)
+           {
+             if (! last_t)
+               nonlocal_labels = TREE_CHAIN (nonlocal_labels);
+             else
+               TREE_CHAIN (last_t) = TREE_CHAIN (t);
+           }
+       }
       if (GET_CODE (insn) == INSN
          && ((nonlocal_goto_handler_slot != 0
               && reg_mentioned_p (nonlocal_goto_handler_slot, PATTERN (insn)))