aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index fe74218..84f2aaa 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -6321,7 +6321,14 @@ grokvardecl (tree type,
}
if (declspecs->specs[(int)ds_thread])
- DECL_TLS_MODEL (decl) = decl_default_tls_model (decl);
+ {
+ if (targetm.have_tls)
+ DECL_TLS_MODEL (decl) = decl_default_tls_model (decl);
+ else
+ /* A mere warning is sure to result in improper semantics
+ at runtime. Don't bother to allow this to compile. */
+ error ("thread-local storage not supported for this target");
+ }
if (TREE_PUBLIC (decl))
{
@@ -8449,7 +8456,15 @@ grokdeclarator (const cp_declarator *declarator,
DECL_EXTERNAL (decl) = 1;
if (thread_p)
- DECL_TLS_MODEL (decl) = decl_default_tls_model (decl);
+ {
+ if (targetm.have_tls)
+ DECL_TLS_MODEL (decl) = decl_default_tls_model (decl);
+ else
+ /* A mere warning is sure to result in improper
+ semantics at runtime. Don't bother to allow this to
+ compile. */
+ error ("thread-local storage not supported for this target");
+ }
}
else
{