summaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authoriains <iains@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-24 14:36:32 +0000
committeriains <iains@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-24 14:36:32 +0000
commit01a5cbdfc72164602f3cc41d22c78001c1da2adb (patch)
tree572e1afe3e6475f92e50a9110276f5d8b13583fa /gcc/toplev.c
parent0d2f70701128ba3e37a82d5d783599414f29c7ca (diff)
downloadgcc-01a5cbdfc72164602f3cc41d22c78001c1da2adb.tar.gz
2010-05-24 Iain Sandoe <iains@gcc.gnu.org>
PR target/44132 PR middle-end/43602 * varasm.c (get_emutls_init_templ_addr): Copy DECL_PRESERVE_P, DECL_VISIBILITY_SPECIFIED. (emutls_decl): Set DECL_PRESERVE_P and copy DECL_VISIBILITY_SPECIFIED, DECL_RESTRICTED_P. (emutls_finalize_control_var): New callback. (emutls_finish): Finalize emutls control variables. * toplev.c (compile_file): Move the call to emutls_finish () before varpool_assemble_pending_decls (). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159781 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 3cf65bad077..fcd720dd9a9 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1063,6 +1063,11 @@ compile_file (void)
if (errorcount || sorrycount)
return;
+ /* Ensure that emulated TLS control vars are finalized and build
+ a static constructor for them, when it is required. */
+ if (!targetm.have_tls)
+ emutls_finish ();
+
varpool_assemble_pending_decls ();
finish_aliases_2 ();
@@ -1070,10 +1075,6 @@ compile_file (void)
if (flag_mudflap)
mudflap_finish_file ();
- /* Likewise for emulated thread-local storage. */
- if (!targetm.have_tls)
- emutls_finish ();
-
output_shared_constant_pool ();
output_object_blocks ();