aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-nested.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2005-10-03 13:57:45 -0700
committerRichard Henderson <rth@gcc.gnu.org>2005-10-03 13:57:45 -0700
commit1718a2aa9b1715961e514331aea0f5aacc611580 (patch)
tree81e9e5184f6f865cedc0d6d7a7a0898ce3083a1a /gcc/tree-nested.c
parentbb13c3502be2c6eda1771e10f95f615b71d4d026 (diff)
downloadgcc-1718a2aa9b1715961e514331aea0f5aacc611580.zip
gcc-1718a2aa9b1715961e514331aea0f5aacc611580.tar.gz
gcc-1718a2aa9b1715961e514331aea0f5aacc611580.tar.bz2
re PR middle-end/24135 (nonlocal goto from nested function gets 'undefined symbol' in assembler)
PR 24135 * tree-nested.c (convert_nl_goto_reference): Lookup a translation before creating a new one. From-SVN: r104911
Diffstat (limited to 'gcc/tree-nested.c')
-rw-r--r--gcc/tree-nested.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index d42c583..27819db 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -1089,7 +1089,7 @@ convert_nl_goto_reference (tree *tp, int *walk_subtrees, void *data)
struct walk_stmt_info *wi = data;
struct nesting_info *info = wi->info, *i;
tree t = *tp, label, new_label, target_context, x, arg, field;
- struct var_map_elt *elt;
+ struct var_map_elt *elt, dummy;
void **slot;
*walk_subtrees = 0;
@@ -1110,17 +1110,23 @@ convert_nl_goto_reference (tree *tp, int *walk_subtrees, void *data)
control transfer. This new label will be marked LABEL_NONLOCAL; this
mark will trigger proper behavior in the cfg, as well as cause the
(hairy target-specific) non-local goto receiver code to be generated
- when we expand rtl. */
- new_label = create_artificial_label ();
- DECL_NONLOCAL (new_label) = 1;
-
- /* Enter this association into var_map so that we can insert the new
- label into the IL during a second pass. */
- elt = ggc_alloc (sizeof (*elt));
- elt->old = label;
- elt->new = new_label;
- slot = htab_find_slot (i->var_map, elt, INSERT);
- *slot = elt;
+ when we expand rtl. Enter this association into var_map so that we
+ can insert the new label into the IL during a second pass. */
+ dummy.old = label;
+ slot = htab_find_slot (i->var_map, &dummy, INSERT);
+ elt = *slot;
+ if (elt == NULL)
+ {
+ new_label = create_artificial_label ();
+ DECL_NONLOCAL (new_label) = 1;
+
+ elt = ggc_alloc (sizeof (*elt));
+ elt->old = label;
+ elt->new = new_label;
+ *slot = elt;
+ }
+ else
+ new_label = elt->new;
/* Build: __builtin_nl_goto(new_label, &chain->nl_goto_field). */
field = get_nl_goto_field (i);