aboutsummaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-10-14 23:30:19 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2009-10-14 23:30:19 +0200
commit4c0a0455ea294773f73269bbc379d73d0ec8ee2d (patch)
treeb1eca65a0da15045dcc67a9ebb56095343d5255d /gcc/stor-layout.c
parent3e8c245c4ec920ff3728866cebd2b8dd99c034e4 (diff)
downloadgcc-4c0a0455ea294773f73269bbc379d73d0ec8ee2d.zip
gcc-4c0a0455ea294773f73269bbc379d73d0ec8ee2d.tar.gz
gcc-4c0a0455ea294773f73269bbc379d73d0ec8ee2d.tar.bz2
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
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c6
1 files changed, 4 insertions, 2 deletions
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