aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-06-30 02:25:17 +0000
committerRichard Stallman <rms@gnu.org>1992-06-30 02:25:17 +0000
commitf3ee8ad13396dad3d2cbded7a3d7db44f5c75d22 (patch)
treef9a99da245f5ea9f573862cd1a2c3928a7b1b3d0 /gcc/c-common.c
parent20912ad055cda5d3ac550685dc266b4e177a77b7 (diff)
downloadgcc-f3ee8ad13396dad3d2cbded7a3d7db44f5c75d22.zip
gcc-f3ee8ad13396dad3d2cbded7a3d7db44f5c75d22.tar.gz
gcc-f3ee8ad13396dad3d2cbded7a3d7db44f5c75d22.tar.bz2
(decl_attributes): For `packed' on VAR_DECL, set DECL_PACKED and DECL_ALIGN.
From-SVN: r1354
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 8dc92d8..82558ff 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -198,10 +198,15 @@ decl_attributes (decl, attributes)
{
if (TREE_CODE (decl) == FIELD_DECL)
DECL_PACKED (decl) = 1;
+ else if (TREE_CODE (decl) == VAR_DECL)
+ {
+ DECL_PACKED (decl) = 1;
+ DECL_ALIGN (decl) = BITS_PER_UNION;
+ }
}
else if (TREE_VALUE (a) != 0
- && TREE_CODE (TREE_VALUE (a)) == TREE_LIST
- && TREE_PURPOSE (TREE_VALUE (a)) == get_identifier ("mode"))
+ && TREE_CODE (TREE_VALUE (a)) == TREE_LIST
+ && TREE_PURPOSE (TREE_VALUE (a)) == get_identifier ("mode"))
{
int i;
char *specified_name