From 13c1cd82670b0be75bf99ba5bd23a7c34460fe65 Mon Sep 17 00:00:00 2001 From: Paul Brook Date: Fri, 14 May 2004 12:53:11 +0000 Subject: stor-layout.c (update_alignment_for_field): Use targetm.align_anon_bitfield. * stor-layout.c (update_alignment_for_field): Use targetm.align_anon_bitfield. * target-def.h (TARGET_ALIGN_ANON_BITFIELD): Define. (TARGET_INITIALIZER): Use it. * target.h (struct gcc_target): Add align_anon_bitfield. * config/arm/arm.c (arm_align_anon_bitfield): New function. (TARGET_ALIGN_ANON_BITFIELD): Define. * doc/tm.texi: Document TARGET_ALIGN_ANON_BITFIELD. From-SVN: r81838 --- gcc/stor-layout.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/stor-layout.c') diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 13f95a4..5c87a63 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -771,8 +771,10 @@ update_alignment_for_field (record_layout_info rli, tree field, else if (is_bitfield && PCC_BITFIELD_TYPE_MATTERS) { /* Named bit-fields cause the entire structure to have the - alignment implied by their type. */ - if (DECL_NAME (field) != 0) + alignment implied by their type. Some targets also apply the same + rules to unnamed bitfields. */ + if (DECL_NAME (field) != 0 + || targetm.align_anon_bitfield ()) { unsigned int type_align = TYPE_ALIGN (type); -- cgit v1.1