[PATCH] D14980: PR18513: make gcc compatible layout for bit-fields with explicit aligned attribute

Dmitry Polukhin via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 4 01:28:55 PST 2015


DmitryPolukhin added inline comments.

================
Comment at: lib/AST/RecordLayoutBuilder.cpp:1606
@@ +1605,3 @@
+    } else if (ExplicitFieldAlign &&
+               Context.getTargetInfo().useBitFieldTypeAlignment())
+      FieldOffset = llvm::RoundUpToAlignment(FieldOffset, ExplicitFieldAlign);
----------------
rjmccall wrote:
> No, that's what I meant by needing a rebuilt GCC; GCC apparently doesn't apply the APCS struct layout rules correctly when you just set -mabi, because the GCC design configures those things at build time.
> 
> I agree that it's most reasonable not to worry about it; however, I wouldn't disable your changes under APCS, because that suggests something misleading: it suggests you actually did the investigation to decide that APCS layout ignores explicit alignment.  I find it unlikely that GCC's APCS layout completely ignores these attributes.
So do you suggest just add TODO here and remove checks for APCS as it was in previous patch set?


http://reviews.llvm.org/D14980





More information about the cfe-commits mailing list