diff options
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 8ea1489..18fc729 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -930,11 +930,14 @@ decl_attributes (node, attributes, prefix_attributes) pri = TREE_INT_CST_LOW (initp_expr); + while (TREE_CODE (type) == ARRAY_TYPE) + type = TREE_TYPE (type); + if (is_type || TREE_CODE (decl) != VAR_DECL || ! TREE_STATIC (decl) || DECL_EXTERNAL (decl) - || (TREE_CODE (TREE_TYPE (decl)) != RECORD_TYPE - && TREE_CODE (TREE_TYPE (decl)) != UNION_TYPE) + || (TREE_CODE (type) != RECORD_TYPE + && TREE_CODE (type) != UNION_TYPE) /* Static objects in functions are initialized the first time control passes through that function. This is not precise enough to pin down an |