This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]