Allow dynamic initialization of thread_locals.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Oct 2012 14:45:37 +0000 (14:45 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Oct 2012 14:45:37 +0000 (14:45 +0000)
commit462819c8e20aab1124e95392974dd55cd70350f3
treebc70ed3cb42f2f1614f8ad5ac0a05170d55fe604
parentdb019d30742cffe8f8d86560ea33e61b35269321
Allow dynamic initialization of thread_locals.
gcc/cp/
* decl.c: Define tls_aggregates.
(expand_static_init): Remove sorry.  Add to tls_aggregates.
* cp-tree.h: Declare tls_aggregates.
* call.c (set_up_extended_ref_temp): Add to tls_aggregates.
* decl2.c (var_needs_tls_wrapper): New.
(var_defined_without_dynamic_init): New.
(get_tls_init_fn, get_tls_wrapper_fn): New.
(generate_tls_wrapper, handle_tls_init): New.
(cp_write_global_declarations): Call handle_tls_init and
enerate_tls_wrapper.
* mangle.c (write_guarded_var_name): Split out from..
(mangle_guard_variable): ...here.
(mangle_tls_init_fn, mangle_tls_wrapper_fn): Use it.
(decl_tls_wrapper_p): New.
* semantics.c (finish_id_expression): Replace use of thread_local
variable with a call to its wrapper.
libiberty/
* cp-demangle.c (d_special_name, d_dump): Handle TH and TW.
(d_make_comp, d_print_comp): Likewise.
include/
* demangle.h (enum demangle_component_type): Add
DEMANGLE_COMPONENT_TLS_INIT and DEMANGLE_COMPONENT_TLS_WRAPPER.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192211 138bc75d-0d04-0410-961f-82ee72b054a4
33 files changed:
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/mangle.c
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/gomp/tls-5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/gomp/tls-wrap1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/gomp/tls-wrap2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/gomp/tls-wrap3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/gomp/tls-wrap4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/gomp/tls-wrapper-cse.C [new file with mode: 0644]
gcc/testsuite/g++.dg/tls/thread_local-cse.C [new file with mode: 0644]
gcc/testsuite/g++.dg/tls/thread_local-order1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/tls/thread_local-order2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/tls/thread_local-wrap1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/tls/thread_local-wrap2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/tls/thread_local-wrap3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/tls/thread_local-wrap4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/tls/thread_local2g.C [new file with mode: 0644]
gcc/testsuite/g++.dg/tls/thread_local3g.C [new file with mode: 0644]
gcc/testsuite/g++.dg/tls/thread_local4g.C [new file with mode: 0644]
gcc/testsuite/g++.dg/tls/thread_local5g.C [new file with mode: 0644]
gcc/testsuite/g++.dg/tls/thread_local6g.C [new file with mode: 0644]
gcc/testsuite/g++.dg/tls/thread_local7g.C [new file with mode: 0644]
include/ChangeLog
include/demangle.h
libgomp/ChangeLog
libgomp/testsuite/libgomp.c++/tls-init1.C [new file with mode: 0644]
libiberty/ChangeLog
libiberty/cp-demangle.c