This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][AIX] Fix Zero-width bit fields wrt MaxFieldAlign.
ClosedPublic

Authored by sfertile on Jul 8 2021, 8:05 AM.

Details

Summary

On AIX when there is a pragma pack, or pragma align in effect then zero-width bitfields should pad out to the end of the bitfield container but not increase the alignment requirements of the struct greater then the max field align.

Diff Detail

Event Timeline

sfertile created this revision.Jul 8 2021, 8:05 AM
sfertile requested review of this revision.Jul 8 2021, 8:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 8 2021, 8:05 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
ZarkoCA accepted this revision.Jul 9 2021, 10:54 AM
ZarkoCA added a subscriber: ZarkoCA.

LGTM but I have a strong preference that clang/test/Layout/aix-packed-bitfields.c be committed separately if my understanding is right.

clang/test/Layout/aix-bitfield-alignment.c
236

nit: I prefer having these test cases together with the other #pragma align/pack test cases.

clang/test/Layout/aix-packed-bitfields.c
2

AFAIU this test case is not affected by your changes here. Maybe commit this as a separate NFC patch?

This revision is now accepted and ready to land.Jul 9 2021, 10:54 AM