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

John McCall via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 4 01:15:20 PST 2015


rjmccall added inline comments.

================
Comment at: lib/AST/RecordLayoutBuilder.cpp:1606
@@ +1605,3 @@
+    } else if (ExplicitFieldAlign &&
+               Context.getTargetInfo().useBitFieldTypeAlignment())
+      FieldOffset = llvm::RoundUpToAlignment(FieldOffset, ExplicitFieldAlign);
----------------
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.


http://reviews.llvm.org/D14980





More information about the cfe-commits mailing list