* tree-inline.c (copy_body_r): Remap labels correctly.
authorJan Hubicka <hubicka@gcc.gnu.org>
Thu, 23 Jun 2005 13:20:02 +0000 (13:20 +0000)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 23 Jun 2005 13:20:02 +0000 (13:20 +0000)
From-SVN: r101266

gcc/tree-inline.c

index ee30ccc92b089598cbc83373f7520a8ab0eaee30..c670c5712a7740c71dd8e1f7b79c1ad167269746 100644 (file)
@@ -554,9 +554,11 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
     copy_statement_list (tp);
   else if (TREE_CODE (*tp) == SAVE_EXPR)
     remap_save_expr (tp, id->decl_map, walk_subtrees);
-  else if (TREE_CODE (*tp) == LABEL_DECL)
+  else if (TREE_CODE (*tp) == LABEL_DECL
+          && (! DECL_CONTEXT (*tp)
+              || decl_function_context (*tp) == id->callee))
     /* These may need to be remapped for EH handling.  */
-    remap_decl (*tp, id);
+    *tp = remap_decl (*tp, id);
   else if (TREE_CODE (*tp) == BIND_EXPR)
     copy_bind_expr (tp, walk_subtrees, id);
   /* Types may need remapping as well.  */