summaryrefslogtreecommitdiffstats
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-07 23:20:35 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-07 23:20:35 +0000
commitfced8f42570a4579de711485e47af074bab3f9d4 (patch)
tree9937e8dd70694ce6598cdf005340e12b054b06a7 /gcc/stor-layout.c
parent8d0cec1aac35fc9f496a6ca4d9e13d44ce8dd704 (diff)
downloadppe42-gcc-fced8f42570a4579de711485e47af074bab3f9d4.tar.gz
ppe42-gcc-fced8f42570a4579de711485e47af074bab3f9d4.zip
* stor-layout.c (place_union_field): For bitfields if
PCC_BITFIELD_TYPE_MATTERS and TYPE_USER_ALIGN, set record's TYPE_USER_ALIGN. * gcc.dg/bitfld-3.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56112 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 5a4041e5af0..28d8f6218d1 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -694,6 +694,7 @@ place_union_field (rli, field)
#endif
rli->record_align = MAX (rli->record_align, type_align);
rli->unpadded_align = MAX (rli->unpadded_align, type_align);
+ TYPE_USER_ALIGN (rli->t) |= TYPE_USER_ALIGN (TREE_TYPE (field));
}
#endif
@@ -849,6 +850,7 @@ place_field (rli, field)
rli->unpadded_align = MAX (rli->unpadded_align, DECL_ALIGN (field));
if (warn_packed)
rli->unpacked_align = MAX (rli->unpacked_align, TYPE_ALIGN (type));
+ user_align |= TYPE_USER_ALIGN (type);
}
}
else
@@ -941,6 +943,8 @@ place_field (rli, field)
- (offset * BITS_PER_UNIT + bit_offset) / type_align)
> tree_low_cst (TYPE_SIZE (type), 1) / type_align)
rli->bitpos = round_up (rli->bitpos, type_align);
+
+ user_align |= TYPE_USER_ALIGN (type);
}
#endif
@@ -982,6 +986,8 @@ place_field (rli, field)
!= ((offset * BITS_PER_UNIT + bit_offset + field_size - 1)
/ type_align))
rli->bitpos = round_up (rli->bitpos, type_align);
+
+ user_align |= TYPE_USER_ALIGN (type);
}
#endif
OpenPOWER on IntegriCloud