From 4c0a0455ea294773f73269bbc379d73d0ec8ee2d Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 14 Oct 2009 23:30:19 +0200 Subject: stor-layout.c (place_field): Don't emit -Wpadded warnings for fields in builtin structs. * stor-layout.c (place_field): Don't emit -Wpadded warnings for fields in builtin structs. (finalize_record_size): Likewise. * obj-c++.dg/layout-1.mm: Don't xfail dg-bogus on lp64, change line from 1 to 0. * obj-c++.dg/bitfield-1.mm: Likewise. * obj-c++.dg/bitfield-4.mm: Likewise. From-SVN: r152780 --- 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 5967fb5..d070b10 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -1118,7 +1118,8 @@ place_field (record_layout_info rli, tree field) /* No, we need to skip space before this field. Bump the cumulative size to multiple of field alignment. */ - warning (OPT_Wpadded, "padding struct to align %q+D", field); + if (DECL_SOURCE_LOCATION (field) != BUILTINS_LOCATION) + warning (OPT_Wpadded, "padding struct to align %q+D", field); /* If the alignment is still within offset_align, just align the bit position. */ @@ -1483,7 +1484,8 @@ finalize_record_size (record_layout_info rli) = round_up_loc (input_location, unpadded_size_unit, TYPE_ALIGN_UNIT (rli->t)); if (TREE_CONSTANT (unpadded_size) - && simple_cst_equal (unpadded_size, TYPE_SIZE (rli->t)) == 0) + && simple_cst_equal (unpadded_size, TYPE_SIZE (rli->t)) == 0 + && input_location != BUILTINS_LOCATION) warning (OPT_Wpadded, "padding struct size to alignment boundary"); if (warn_packed && TREE_CODE (rli->t) == RECORD_TYPE -- cgit v1.1