This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/52238] New: -mms-bitfields: __attribute__ ((aligned (n))) ignored for struct members
- From: "michael.kostylev at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 13 Feb 2012 19:14:10 +0000
- Subject: [Bug c/52238] New: -mms-bitfields: __attribute__ ((aligned (n))) ignored for struct members
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52238
Bug #: 52238
Summary: -mms-bitfields: __attribute__ ((aligned (n))) ignored
for struct members
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: michael.kostylev@gmail.com
The following test case
% cat > test.c << __EOF && gcc -mms-bitfields test.c && { ./a.out ; echo $? ; }
struct {
char a;
char b __attribute__ ((aligned (16)));
} s;
int main()
{
return (__PTRDIFF_TYPE__)&s.b & 15;
}
__EOF
returns 1, since s.b is not 16-byte aligned (with -mno-ms-bitfields it returns
0, as expected). The test passes with 4.1.2, but fails with 4.2.1 and above.