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
This commit is contained in:
Jakub Jelinek 2009-10-14 23:30:19 +02:00 committed by Jakub Jelinek
parent 3e8c245c4e
commit 4c0a0455ea
6 changed files with 20 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2009-10-14 Jakub Jelinek <jakub@redhat.com>
* stor-layout.c (place_field): Don't emit -Wpadded warnings for
fields in builtin structs.
(finalize_record_size): Likewise.
2009-10-14 Richard Guenther <rguenther@suse.de>
* gimple.c (gtc_ob): New global.

View File

@ -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

View File

@ -1,3 +1,10 @@
2009-10-14 Jakub Jelinek <jakub@redhat.com>
* 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.
2009-10-14 Richard Guenther <rguenther@suse.de>
PR lto/41173

View File

@ -115,7 +115,7 @@ int main(void)
}
/* { dg-prune-output "In file included from" } Ignore this message. */
/* { dg-bogus "padding struct to align" "PR23610" { xfail lp64 } 1 } */
/* { dg-bogus "padding struct to align" "PR23610" { target *-*-* } 0 } */
/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 42 } */
/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 45 } */
/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 59 } */

View File

@ -50,7 +50,7 @@ int main(void)
}
/* { dg-prune-output "In file included from" } Ignore this message. */
/* { dg-bogus "padding struct to align" "PR23610" { xfail lp64 } 1 } */
/* { dg-bogus "padding struct to align" "PR23610" { target *-*-* } 0 } */
/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 28 } */
/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 34 } */

View File

@ -14,4 +14,4 @@
@end
/* { dg-prune-output "In output included from" } Ignore this message. */
/* { dg-bogus "padding struct to align" "PR23610" { xfail lp64 } 1 } */
/* { dg-bogus "padding struct to align" "PR23610" { target *-*-* } 0 } */