[cfe-commits] r124661 - in /cfe/trunk: include/clang/Basic/DiagnosticFrontendKinds.td include/clang/Basic/LangOptions.h include/clang/Driver/CC1Options.td include/clang/Driver/Options.td lib/AST/RecordLayoutBuilder.cpp lib/Driver/Tools.cpp lib/Fr

Carl Norum carl.norum at apple.com
Wed Feb 2 14:39:21 PST 2011

On Feb 2, 2011, at 1:55 PM, Daniel Dunbar wrote:
> Ok, but...
> Based on the limited information I have seen on -mms-bitfields, I
> think this patch is leaving out significant pieces if the ms bitfields
> layout algorithm.

Absolutely true - it's only a partial implementation.  All I needed to get EFI building/working was to get 64-bit fields aligned on 64-bit boundaries (even for 32-bit targets) so that structures shared between PEI (32-bit pre-memory initialization code) & DXE (64-bit drivers) would work out the same.  For gcc, that meant using the -mms-bitfields flag, and that's why I used the same flag for my partial implementation.

> Carl, do you have a good feel for what is missing? To me it looks
> specifically like the bitfield layout algorithm also needs
> modification.

Sorry - all I know is from the link I sent out earlier:


The patches I submitted only really address #2 from that link: "Every data object has an alignment-requirement. The alignment-requirement for all data except structures, unions, and arrays is either the size of the object or the current packing size (specified with either the aligned attribute or the pack pragma), whichever is less. For structures, unions, and arrays, the alignment-requirement is the largest alignment-requirement of its members."  I don't really grok the whole set of requirements or how the current clang implementation might match or not match those requirements.

> Can we make sure we at least have bugzillas tracking known issues?

I filed "<rdar://problem/8591866> -mms-bitfields doesn't work with clang" back in October - should I duplicate that to a public bug repository somewhere?

-- Carl

More information about the cfe-commits mailing list