aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/stor-layout.c6
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/obj-c++.dg/bitfield-1.mm2
-rw-r--r--gcc/testsuite/obj-c++.dg/bitfield-4.mm2
-rw-r--r--gcc/testsuite/obj-c++.dg/layout-1.mm2
6 files changed, 20 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4385018..a186123 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 15a1a6d..e1940c4 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
diff --git a/gcc/testsuite/obj-c++.dg/bitfield-1.mm b/gcc/testsuite/obj-c++.dg/bitfield-1.mm
index d9b65a4..f17d9f0 100644
--- a/gcc/testsuite/obj-c++.dg/bitfield-1.mm
+++ b/gcc/testsuite/obj-c++.dg/bitfield-1.mm
@@ -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 } */
diff --git a/gcc/testsuite/obj-c++.dg/bitfield-4.mm b/gcc/testsuite/obj-c++.dg/bitfield-4.mm
index 72c1396..a2c2173 100644
--- a/gcc/testsuite/obj-c++.dg/bitfield-4.mm
+++ b/gcc/testsuite/obj-c++.dg/bitfield-4.mm
@@ -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 } */
diff --git a/gcc/testsuite/obj-c++.dg/layout-1.mm b/gcc/testsuite/obj-c++.dg/layout-1.mm
index 35ffa49..bc99e75 100644
--- a/gcc/testsuite/obj-c++.dg/layout-1.mm
+++ b/gcc/testsuite/obj-c++.dg/layout-1.mm
@@ -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 } */