aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1996-06-10 11:29:39 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1996-06-10 11:29:39 -0400
commit62b1077c623174430ef596b73cc5d1480a08100a (patch)
tree3be1b7709296e915859126a128380952f9db8673 /gcc/c-common.c
parent76565a249e558a9c9ddde2da934929becd8d293e (diff)
downloadgcc-62b1077c623174430ef596b73cc5d1480a08100a.zip
gcc-62b1077c623174430ef596b73cc5d1480a08100a.tar.gz
gcc-62b1077c623174430ef596b73cc5d1480a08100a.tar.bz2
(decl_attributes, case A_T_UNION): Don't look at fields of union if
there aren't any. From-SVN: r12256
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 04c1ef3..c74a1a8 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -408,7 +408,8 @@ decl_attributes (node, attributes, prefix_attributes)
if (is_type
&& TREE_CODE (type) == UNION_TYPE
&& (decl == 0
- || TYPE_MODE (type) == DECL_MODE (TYPE_FIELDS (type))))
+ || (TYPE_FIELDS (type) != 0
+ && TYPE_MODE (type) == DECL_MODE (TYPE_FIELDS (type)))))
TYPE_TRANSPARENT_UNION (type) = 1;
else if (decl != 0 && TREE_CODE (decl) == PARM_DECL
&& TREE_CODE (type) == UNION_TYPE