aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2009-02-05 01:18:02 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2009-02-05 01:18:02 +0000
commit5006381cc14df7bfb634b249f50b1bf30f39f841 (patch)
tree56e68154a7b8fc728b201d3220d4c952afea9169 /gcc/c-common.c
parentb0789219a39008bf034a14d6da94cdc03c2f3d38 (diff)
downloadgcc-5006381cc14df7bfb634b249f50b1bf30f39f841.zip
gcc-5006381cc14df7bfb634b249f50b1bf30f39f841.tar.gz
gcc-5006381cc14df7bfb634b249f50b1bf30f39f841.tar.bz2
re PR c/35435 (ICE with attribute tls_model in typedef)
PR c/35435 * c-common.c (handle_tls_model_attribute): Ignore attribute for non-VAR_DECLs without checking DECL_THREAD_LOCAL_P. testsuite: * gcc.dg/tls/diag-6.c: New test. From-SVN: r143948
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 81992d4..dbc9676 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -6263,7 +6263,7 @@ handle_tls_model_attribute (tree *node, tree name, tree args,
*no_add_attrs = true;
- if (!DECL_THREAD_LOCAL_P (decl))
+ if (TREE_CODE (decl) != VAR_DECL || !DECL_THREAD_LOCAL_P (decl))
{
warning (OPT_Wattributes, "%qE attribute ignored", name);
return NULL_TREE;