This is the mail archive of the
mailing list for the GCC project.
PING: PATCH to place_field for c++/42837 (abi/packed1.C failure on non-strict aligment targets)
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 22 Feb 2010 17:15:42 -0500
- Subject: PING: PATCH to place_field for c++/42837 (abi/packed1.C failure on non-strict aligment targets)
-------- Original Message --------
Subject: RFA: PATCH to place_field for c++/42837 (abi/packed1.C failure
on strict aligment targets)
Date: Fri, 19 Feb 2010 10:53:53 -0500
From: Jason Merrill <firstname.lastname@example.org>
To: gcc-patches List <email@example.com>
CC: H.J. Lu <firstname.lastname@example.org>
On 02/19/2010 12:15 AM, H.J. Lu wrote:
The test failed on Linux/ia32:
FAIL: g++.dg/abi/packed1.C (test for excess errors)
Oops. This patch fixes that; it doesn't make sense to warn about a
particular field being unnecessarily packed if the whole type is.
Testing now. OK for trunk if it passes?
Author: Jason Merrill <email@example.com>
Date: Fri Feb 19 10:45:57 2010 -0500
* stor-layout.c (place_field): Don't warn about unnecessary DECL_PACKED
if the type is packed.
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 6f08d8c..1806c12 100644
@@ -1100,7 +1100,8 @@ place_field (record_layout_info rli, tree field)
warning (OPT_Wattributes, "packed attribute causes "
"inefficient alignment for %q+D", field);
+ /* Don't warn if DECL_PACKED was set by the type. */
+ else if (!TYPE_PACKED (rli->t))
warning (OPT_Wattributes, "packed attribute is "
"unnecessary for %q+D", field);