[Bug c/52238] New: -mms-bitfields: __attribute__ ((aligned (n))) ignored for struct members

michael.kostylev at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Feb 13 19:14:00 GMT 2012


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.



More information about the Gcc-bugs mailing list