This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/39514] [4.4 Regression] unreported change to packed bitfields
- From: "ebotcazou at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Mar 2009 11:47:34 -0000
- Subject: [Bug middle-end/39514] [4.4 Regression] unreported change to packed bitfields
- References: <bug-39514-4503@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from ebotcazou at gcc dot gnu dot org 2009-03-23 11:47 -------
> I'd like to see this message, which is on by default, for the change
> introduced in r132614. I haven't figured out how to determine if the offset
> for a field has changed, just the alignment. I'll attach my current patch,
> where the message should be "Perhaps the alignment of packed bit-field <x>
> has changed in GCC 4.4", which is not terribly useful.
I think that's better (without the "perhaps", the alignment is always changed)
than "Offset" because this also can change the padding of the structure:
struct s
{
struct
{
__attribute__ ((aligned (2))) int d:32;
} __attribute__ ((packed)) c;
unsigned short int e;
};
yields (4, 8) with 4.3.3 and (4, 6) with mainline. This apparently will be so
uncommon in C/C++ (packed bit-field with alignment attribute) that I'm not sure
sure we need to tune it further.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39514