aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2013-01-19 05:25:25 +0000
committerJason Merrill <jason@redhat.com>2013-01-19 05:25:25 +0000
commit4dc6a9991696ad67413d8b6d221c0e6334ea9d09 (patch)
tree6f07da7f6452368c46a7fccdd8d5a008127dbe83 /gcc/c-family
parentec465c1c01bbe0391c1c07e9a9b191328adb5859 (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/c-family')
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c-opts.c14
-rw-r--r--gcc/c-family/c.opt3
3 files changed, 23 insertions, 0 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 778be4b5395..d4f989be630 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2013-01-18 Jason Merrill <jason@redhat.com>
+
+ PR target/54908
+ * c.opt (-fextern-tls-init): New.
+ * c-opts.c (c_common_post_options): Handle it.
+
2013-01-09 Jakub Jelinek <jakub@redhat.com>
PR c/48418
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index 3fabb36faff..1a922a81c35 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -901,6 +901,20 @@ c_common_post_options (const char **pfilename)
else if (warn_narrowing == -1)
warn_narrowing = 0;
+ if (flag_extern_tls_init)
+ {
+#if !defined (ASM_OUTPUT_DEF) || !SUPPORTS_WEAK
+ /* Lazy TLS initialization for a variable in another TU requires
+ alias and weak reference support. */
+ if (flag_extern_tls_init > 0)
+ sorry ("external TLS initialization functions not supported "
+ "on this target");
+ flag_extern_tls_init = 0;
+#else
+ flag_extern_tls_init = 1;
+#endif
+ }
+
if (flag_preprocess_only)
{
/* Open the output now. We must do so even if flag_no_output is
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 187f3befc18..10ae84dbb24 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -913,6 +913,9 @@ finput-charset=
C ObjC C++ ObjC++ Joined RejectNegative
-finput-charset=<cset> Specify the default character set for source files
+fextern-tls-init
+C++ ObjC++ Var(flag_extern_tls_init) Init(-1)
+Support dynamic initialization of thread-local variables in a different translation unit
fexternal-templates
C++ ObjC++ Ignore Warn(switch %qs is no longer supported)