diff options
author | Jason Merrill <jason@redhat.com> | 2013-01-19 05:25:25 +0000 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2013-01-19 05:25:25 +0000 |
commit | 4dc6a9991696ad67413d8b6d221c0e6334ea9d09 (patch) | |
tree | 6f07da7f6452368c46a7fccdd8d5a008127dbe83 /gcc/doc | |
parent | ec465c1c01bbe0391c1c07e9a9b191328adb5859 (diff) |
PR target/54908
c-family/
* c.opt (-fextern-tls-init): New.
* c-opts.c (c_common_post_options): Handle it.
cp/
* decl2.c (get_local_tls_init_fn): New.
(get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
with aliases for internal variables. Don't use weakrefs if
the variable needs destruction.
(generate_tls_wrapper): Mark the wrapper as const if no
initialization is needed.
(handle_tls_init): Don't require aliases.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@195310 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 887d31eec20..d60ac9f3689 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -2029,6 +2029,29 @@ exceptions in violation of the exception specifications; the compiler still optimizes based on the specifications, so throwing an unexpected exception results in undefined behavior at run time. +@item -fextern-tls-init +@itemx -fno-extern-tls-init +@opindex fextern-tls-init +@opindex fno-extern-tls-init +The C++11 and OpenMP standards allow @samp{thread_local} and +@samp{threadprivate} variables to have dynamic (runtime) +initialization. To support this, any use of such a variable goes +through a wrapper function that performs any necessary initialization. +When the use and definition of the variable are in the same +translation unit, this overhead can be optimized away, but when the +use is in a different translation unit there is significant overhead +even if the variable doesn't actually need dynamic initialization. If +the programmer can be sure that no use of the variable in a +non-defining TU needs to trigger dynamic initialization (either +because the variable is statically initialized, or a use of the +variable in the defining TU will be executed before any uses in +another TU), they can avoid this overhead with the +@option{-fno-extern-tls-init} option. + +On targets that support symbol aliases, the default is +@option{-fextern-tls-init}. On targets that do not support symbol +aliases, the default is @option{-fno-extern-tls-init}. + @item -ffor-scope @itemx -fno-for-scope @opindex ffor-scope |