[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
Thu Dec 3 06:35:55 PST 2015


DmitryPolukhin added inline comments.

================
Comment at: lib/AST/RecordLayoutBuilder.cpp:1606
@@ -1605,1 +1605,3 @@
+    } else if (ExplicitFieldAlign)
+      FieldOffset = llvm::RoundUpToAlignment(FieldOffset, ExplicitFieldAlign);
 
----------------
rjmccall wrote:
> Be sure to test specifically with an APCS ARM target; newer ARM ABIs don't ignore bit-field layout. Sorry, I should have been more explicit about that. (You can figure this stuff out by looking at the various targets in Targets.cpp that set UseBitFieldTypeAlignment.)
'-triple=arm-apcs-gnu' does give difference with GCC '-target=arm -mabi=apcs-gnu -mfloat-abi=softfp'. But even without my patch I see bunch of difference in layout (i.e. structs a2, a3, c, d, s0). So I just disabled my changes for APCS because it requires more attention than just fix explicit alignment case and I'm not sure that it is used enough nowadays.


http://reviews.llvm.org/D14980





More information about the cfe-commits mailing list