summaryrefslogtreecommitdiff
path: root/gcc/tree-emutls.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-21 23:02:15 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-21 23:02:15 +0000
commita5c9e220e012d7ed8ed4718d6ab133afa904873a (patch)
treef3c758622a05bf79b5f0011c4175e3603ea18de3 /gcc/tree-emutls.c
parent0acc46e324abed7163031ed0bb257402812881c2 (diff)
downloadgcc-a5c9e220e012d7ed8ed4718d6ab133afa904873a.tar.gz
PR target/46510
* tree-emutls.c (get_emutls_init_templ_addr, new_emutls_decl): Do not finalize external decls. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167014 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-emutls.c')
-rw-r--r--gcc/tree-emutls.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/tree-emutls.c b/gcc/tree-emutls.c
index 2a1ec068a85..899888dfb10 100644
--- a/gcc/tree-emutls.c
+++ b/gcc/tree-emutls.c
@@ -257,7 +257,12 @@ get_emutls_init_templ_addr (tree decl)
targetm.emutls.tmpl_section);
}
- varpool_finalize_decl (to);
+ /* Create varpool node for the new variable and finalize it if it is
+ not external one. */
+ if (DECL_EXTERNAL (to))
+ varpool_node (to);
+ else
+ varpool_finalize_decl (to);
return build_fold_addr_expr (to);
}
@@ -324,7 +329,12 @@ new_emutls_decl (tree decl)
record_references_in_initializer (to, false);
}
- varpool_finalize_decl (to);
+ /* Create varpool node for the new variable and finalize it if it is
+ not external one. */
+ if (DECL_EXTERNAL (to))
+ varpool_node (to);
+ else
+ varpool_finalize_decl (to);
return to;
}