<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>Hi Fariborz,</div><div>Comments below.</div><div><br></div><div>On Aug 6, 2011, at 9:23 AM, Fariborz Jahanian wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi Chad,<br>Please see below.<br><br>On Aug 5, 2011, at 3:38 PM, Chad Rosier wrote:<br><br><blockquote type="cite">Author: mcrosier<br></blockquote><blockquote type="cite">Date: Fri Aug  5 17:38:04 2011<br></blockquote><blockquote type="cite">New Revision: 136991<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=136991&view=rev">http://llvm.org/viewvc/llvm-project?rev=136991&view=rev</a><br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite">Add support for using anonymous bitfields (e.g., int : 0) to enforce alignment.<br></blockquote><blockquote type="cite">This fixes cases where the anonymous bitfield is followed by a bitfield member.<br></blockquote><blockquote type="cite">E.g.,<br></blockquote><blockquote type="cite">struct t4<br></blockquote><blockquote type="cite">{<br></blockquote><blockquote type="cite">char foo;<br></blockquote><blockquote type="cite">long : 0;<br></blockquote><blockquote type="cite">char bar : 1;<br></blockquote><blockquote type="cite">};<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><a href="rdar://9859156">rdar://9859156</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified:<br></blockquote><blockquote type="cite">   cfe/trunk/lib/AST/RecordLayoutBuilder.cpp<br></blockquote><blockquote type="cite">   cfe/trunk/test/CodeGen/arm-apcs-zerolength-bitfield.c<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified: cfe/trunk/lib/AST/RecordLayoutBuilder.cpp<br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RecordLayoutBuilder.cpp?rev=136991&r1=136990&r2=136991&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RecordLayoutBuilder.cpp?rev=136991&r1=136990&r2=136991&view=diff</a><br></blockquote><blockquote type="cite">==============================================================================<br></blockquote><blockquote type="cite">--- cfe/trunk/lib/AST/RecordLayoutBuilder.cpp (original)<br></blockquote><blockquote type="cite">+++ cfe/trunk/lib/AST/RecordLayoutBuilder.cpp Fri Aug  5 17:38:04 2011<br></blockquote><blockquote type="cite">@@ -1348,12 +1348,12 @@<br></blockquote><blockquote type="cite">      }<br></blockquote><blockquote type="cite">      LastFD = FD;<br></blockquote><blockquote type="cite">    }<br></blockquote><blockquote type="cite">-    else if (Context.Target.useZeroLengthBitfieldAlignment() &&<br></blockquote><blockquote type="cite">-             !Context.Target.useBitFieldTypeAlignment()) {<br></blockquote><blockquote type="cite">+    else if (!Context.Target.useBitFieldTypeAlignment() &&<br></blockquote><blockquote type="cite">+             Context.Target.useZeroLengthBitfieldAlignment()) {             <br></blockquote><blockquote type="cite">      FieldDecl *FD =  (*Field);<br></blockquote><blockquote type="cite">-      if (Context.ZeroBitfieldFollowsBitfield(FD, LastFD))<br></blockquote><blockquote type="cite">+      if (FD->isBitField() && <br></blockquote><blockquote type="cite">+          FD->getBitWidth()->EvaluateAsInt(Context).getZExtValue() == 0)<br></blockquote><blockquote type="cite">        ZeroLengthBitfield = FD;<br></blockquote><blockquote type="cite">-      LastFD = FD;<br></blockquote><blockquote type="cite">    }<br></blockquote><blockquote type="cite">    LayoutField(*Field);<br></blockquote><blockquote type="cite">  }<br></blockquote><blockquote type="cite">@@ -1411,8 +1411,8 @@<br></blockquote><blockquote type="cite">    setDataSize(std::max(getDataSizeInBits(), FieldSize));<br></blockquote><blockquote type="cite">    FieldOffset = 0;<br></blockquote><blockquote type="cite">  } else {<br></blockquote><blockquote type="cite">-    // The bitfield is allocated starting at the next offset aligned appropriately<br></blockquote><blockquote type="cite">-    // for T', with length n bits.<br></blockquote><blockquote type="cite">+    // The bitfield is allocated starting at the next offset aligned <br></blockquote><blockquote type="cite">+    // appropriately for T', with length n bits.<br></blockquote><blockquote type="cite">    FieldOffset = llvm::RoundUpToAlignment(getDataSizeInBits(), <br></blockquote><blockquote type="cite">                                           Context.toBits(TypeAlign));<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">@@ -1451,19 +1451,30 @@<br></blockquote><blockquote type="cite">    FieldAlign = TypeSize;<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">  if (ZeroLengthBitfield) {<br></blockquote></div></blockquote><div><br></div><div>Notice this code is predicated on the ZeroLengthBitfield variable.</div><br><blockquote type="cite"><div><blockquote type="cite">-    // If a zero-length bitfield is inserted after a bitfield,<br></blockquote><blockquote type="cite">-    // and the alignment of the zero-length bitfield is<br></blockquote><blockquote type="cite">-    // greater than the member that follows it, `bar', `bar' <br></blockquote><blockquote type="cite">-    // will be aligned as the type of the zero-length bitfield.<br></blockquote><blockquote type="cite">-    if (ZeroLengthBitfield != D) {<br></blockquote><blockquote type="cite">-      std::pair<uint64_t, unsigned> FieldInfo = <br></blockquote><blockquote type="cite">-        Context.getTypeInfo(ZeroLengthBitfield->getType());<br></blockquote><blockquote type="cite">-      unsigned ZeroLengthBitfieldAlignment = FieldInfo.second;<br></blockquote><blockquote type="cite">-      // Ignore alignment of subsequent zero-length bitfields.<br></blockquote><blockquote type="cite">-      if ((ZeroLengthBitfieldAlignment > FieldAlign) || (FieldSize == 0))<br></blockquote><blockquote type="cite">-        FieldAlign = ZeroLengthBitfieldAlignment;<br></blockquote><blockquote type="cite">-      if (FieldSize)<br></blockquote><blockquote type="cite">-        ZeroLengthBitfield = 0;<br></blockquote><blockquote type="cite">+    std::pair<uint64_t, unsigned> FieldInfo;<br></blockquote><blockquote type="cite">+    unsigned ZeroLengthBitfieldAlignment;<br></blockquote><blockquote type="cite">+    if (IsMsStruct) {<br></blockquote><br>You added this conditional. I don't recall this right now. Is this code always executed when in ms_strtuct mode, I assume?<br></div></blockquote><div><br></div><div>Revisions 136858 and 136991 added support for using zero length (aka anonymous) bitfields for alignment purposes (for non-ms_struct structs).  Prior to r136858, the ZeroLengthBitfield variable was only set in RecordLayoutBuilder::LayoutFields() like this:</div><div><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><b><font color="#A020F0"><br></font></b></span></div><div><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><b>if</b></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "> (IsMsStruct) {</span></div><div><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; ">  FieldDecl *FD =  (*Field);</span></div><div><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; ">  <b>if</b> (Context.ZeroBitfieldFollowsBitfield(FD, LastFD))</span></div><div><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; ">    ZeroLengthBitfield = FD;</span></div><div><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><div><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre;">    ...</span></font></span></font></div><div><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: Helvetica; white-space: normal; "><br></span></span></font></span></font></div><div><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: Helvetica; white-space: normal; ">All other definitions were setting ZeroLengthBitfield to NULL.</span></span></font></span></font></div><div><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: Helvetica; white-space: normal; "><br></span></span></font></span></font></div><div><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">So, yes, this code was always/only executed when laying out a struct with the ms_struct attribute.  In this work, I reused the ZeroLengthBitfield variable, so I needed to add the conditional you mentioned to distinguish between how zero length bitfields are handled for ms_structs vs. non-ms_structs.</span></font></div><div><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"><br></span></font></div><div><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"> Chad</span></font></div><div><br></div></span></div><blockquote type="cite"><div><br>- Thanks, Fariborz<br><br><blockquote type="cite">+      // If a zero-length bitfield is inserted after a bitfield,<br></blockquote><blockquote type="cite">+      // and the alignment of the zero-length bitfield is<br></blockquote><blockquote type="cite">+      // greater than the member that follows it, `bar', `bar' <br></blockquote><blockquote type="cite">+      // will be aligned as the type of the zero-length bitfield.<br></blockquote><blockquote type="cite">+      if (ZeroLengthBitfield != D) {<br></blockquote><blockquote type="cite">+        FieldInfo = Context.getTypeInfo(ZeroLengthBitfield->getType());<br></blockquote><blockquote type="cite">+        ZeroLengthBitfieldAlignment = FieldInfo.second;<br></blockquote><blockquote type="cite">+        // Ignore alignment of subsequent zero-length bitfields.<br></blockquote><blockquote type="cite">+        if ((ZeroLengthBitfieldAlignment > FieldAlign) || (FieldSize == 0))<br></blockquote><blockquote type="cite">+          FieldAlign = ZeroLengthBitfieldAlignment;<br></blockquote><blockquote type="cite">+        if (FieldSize)<br></blockquote><blockquote type="cite">+          ZeroLengthBitfield = 0;<br></blockquote><blockquote type="cite">+      }<br></blockquote><blockquote type="cite">+    } else {<br></blockquote><blockquote type="cite">+      // The alignment of a zero-length bitfield affects the alignment<br></blockquote><blockquote type="cite">+      // of the next member.  The alignment is the max of the zero <br></blockquote><blockquote type="cite">+      // length bitfield's alignment and a target specific fixed value.<br></blockquote><blockquote type="cite">+      unsigned ZeroLengthBitfieldBoundary =<br></blockquote><blockquote type="cite">+        Context.Target.getZeroLengthBitfieldBoundary();<br></blockquote><blockquote type="cite">+      if (ZeroLengthBitfieldBoundary > FieldAlign)<br></blockquote><blockquote type="cite">+        FieldAlign = ZeroLengthBitfieldBoundary;<br></blockquote><blockquote type="cite">    }<br></blockquote><blockquote type="cite">  }<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">@@ -1476,10 +1487,11 @@<br></blockquote><blockquote type="cite">  // was unnecessary (-Wpacked).<br></blockquote><blockquote type="cite">  unsigned UnpackedFieldAlign = FieldAlign;<br></blockquote><blockquote type="cite">  uint64_t UnpackedFieldOffset = FieldOffset;<br></blockquote><blockquote type="cite">-  if (!Context.Target.useBitFieldTypeAlignment())<br></blockquote><blockquote type="cite">+  if (!Context.Target.useBitFieldTypeAlignment() && !ZeroLengthBitfield)<br></blockquote><blockquote type="cite">    UnpackedFieldAlign = 1;<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">-  if (FieldPacked || !Context.Target.useBitFieldTypeAlignment())<br></blockquote><blockquote type="cite">+  if (FieldPacked || <br></blockquote><blockquote type="cite">+      (!Context.Target.useBitFieldTypeAlignment() && !ZeroLengthBitfield))<br></blockquote><blockquote type="cite">    FieldAlign = 1;<br></blockquote><blockquote type="cite">  FieldAlign = std::max(FieldAlign, D->getMaxAlignment());<br></blockquote><blockquote type="cite">  UnpackedFieldAlign = std::max(UnpackedFieldAlign, D->getMaxAlignment());<br></blockquote><blockquote type="cite">@@ -1500,10 +1512,14 @@<br></blockquote><blockquote type="cite">    UnpackedFieldOffset = llvm::RoundUpToAlignment(UnpackedFieldOffset,<br></blockquote><blockquote type="cite">                                                   UnpackedFieldAlign);<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">-  // Padding members don't affect overall alignment.<br></blockquote><blockquote type="cite">-  if (!D->getIdentifier())<br></blockquote><blockquote type="cite">+  // Padding members don't affect overall alignment, unless zero length bitfield<br></blockquote><blockquote type="cite">+  // alignment is enabled.<br></blockquote><blockquote type="cite">+  if (!D->getIdentifier() && !Context.Target.useZeroLengthBitfieldAlignment())<br></blockquote><blockquote type="cite">    FieldAlign = UnpackedFieldAlign = 1;<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">+  if (!IsMsStruct)<br></blockquote><blockquote type="cite">+    ZeroLengthBitfield = 0;<br></blockquote><blockquote type="cite">+<br></blockquote><blockquote type="cite">  // Place this field at the current location.<br></blockquote><blockquote type="cite">  FieldOffsets.push_back(FieldOffset);<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified: cfe/trunk/test/CodeGen/arm-apcs-zerolength-bitfield.c<br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/arm-apcs-zerolength-bitfield.c?rev=136991&r1=136990&r2=136991&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/arm-apcs-zerolength-bitfield.c?rev=136991&r1=136990&r2=136991&view=diff</a><br></blockquote><blockquote type="cite">==============================================================================<br></blockquote><blockquote type="cite">--- cfe/trunk/test/CodeGen/arm-apcs-zerolength-bitfield.c (original)<br></blockquote><blockquote type="cite">+++ cfe/trunk/test/CodeGen/arm-apcs-zerolength-bitfield.c Fri Aug  5 17:38:04 2011<br></blockquote><blockquote type="cite">@@ -58,8 +58,8 @@<br></blockquote><blockquote type="cite">  char bar : 1;<br></blockquote><blockquote type="cite">  char bar2;<br></blockquote><blockquote type="cite">};<br></blockquote><blockquote type="cite">-static int arr6_offset[(offsetof(struct t6, bar2) == 1) ? 0 : -1];<br></blockquote><blockquote type="cite">-static int arr6_sizeof[(sizeof(struct t6) == 2) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr6_offset[(offsetof(struct t6, bar2) == 5) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr6_sizeof[(sizeof(struct t6) == 8) ? 0 : -1];<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">struct t7<br></blockquote><blockquote type="cite">{<br></blockquote><blockquote type="cite">@@ -68,8 +68,8 @@<br></blockquote><blockquote type="cite">  char bar1 : 1;<br></blockquote><blockquote type="cite">  char bar2;<br></blockquote><blockquote type="cite">};<br></blockquote><blockquote type="cite">-static int arr7_offset[(offsetof(struct t7, bar2) == 1) ? 0 : -1];<br></blockquote><blockquote type="cite">-static int arr7_sizeof[(sizeof(struct t7) == 2) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr7_offset[(offsetof(struct t7, bar2) == 5) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr7_sizeof[(sizeof(struct t7) == 8) ? 0 : -1];<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">struct t8<br></blockquote><blockquote type="cite">{<br></blockquote><blockquote type="cite">@@ -78,8 +78,8 @@<br></blockquote><blockquote type="cite">  char bar1 : 1;<br></blockquote><blockquote type="cite">  char bar2;<br></blockquote><blockquote type="cite">};<br></blockquote><blockquote type="cite">-static int arr8_offset[(offsetof(struct t8, bar2) == 1) ? 0 : -1];<br></blockquote><blockquote type="cite">-static int arr8_sizeof[(sizeof(struct t8) == 2) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr8_offset[(offsetof(struct t8, bar2) == 5) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr8_sizeof[(sizeof(struct t8) == 8) ? 0 : -1];<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">struct t9<br></blockquote><blockquote type="cite">{<br></blockquote><blockquote type="cite">@@ -88,8 +88,8 @@<br></blockquote><blockquote type="cite">  char bar1 : 1;<br></blockquote><blockquote type="cite">  char bar2;<br></blockquote><blockquote type="cite">};<br></blockquote><blockquote type="cite">-static int arr9_offset[(offsetof(struct t9, bar2) == 1) ? 0 : -1];<br></blockquote><blockquote type="cite">-static int arr9_sizeof[(sizeof(struct t9) == 2) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr9_offset[(offsetof(struct t9, bar2) == 5) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr9_sizeof[(sizeof(struct t9) == 8) ? 0 : -1];<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">struct t10<br></blockquote><blockquote type="cite">{<br></blockquote><blockquote type="cite">@@ -98,9 +98,8 @@<br></blockquote><blockquote type="cite">  char bar1 : 1;<br></blockquote><blockquote type="cite">  char bar2;<br></blockquote><blockquote type="cite">};<br></blockquote><blockquote type="cite">-static int arr10_offset[(offsetof(struct t10, bar2) == 1) ? 0 : -1];<br></blockquote><blockquote type="cite">-static int arr10_sizeof[(sizeof(struct t10) == 2) ? 0 : -1];<br></blockquote><blockquote type="cite">-<br></blockquote><blockquote type="cite">+static int arr10_offset[(offsetof(struct t10, bar2) == 5) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr10_sizeof[(sizeof(struct t10) == 8) ? 0 : -1];<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">struct t11<br></blockquote><blockquote type="cite">{<br></blockquote><blockquote type="cite">@@ -110,8 +109,8 @@<br></blockquote><blockquote type="cite">  char bar1 : 1;<br></blockquote><blockquote type="cite">  char bar2;<br></blockquote><blockquote type="cite">};<br></blockquote><blockquote type="cite">-static int arr11_offset[(offsetof(struct t11, bar2) == 1) ? 0 : -1];<br></blockquote><blockquote type="cite">-static int arr11_sizeof[(sizeof(struct t11) == 2) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr11_offset[(offsetof(struct t11, bar2) == 5) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr11_sizeof[(sizeof(struct t11) == 8) ? 0 : -1];<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">struct t12<br></blockquote><blockquote type="cite">{<br></blockquote><blockquote type="cite">@@ -124,6 +123,117 @@<br></blockquote><blockquote type="cite">static int arr12_offset[(offsetof(struct t12, bar) == 4) ? 0 : -1];<br></blockquote><blockquote type="cite">static int arr12_sizeof[(sizeof(struct t12) == 8) ? 0 : -1];<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">+struct t13<br></blockquote><blockquote type="cite">+{<br></blockquote><blockquote type="cite">+  char foo;<br></blockquote><blockquote type="cite">+  long : 0;<br></blockquote><blockquote type="cite">+  char bar;<br></blockquote><blockquote type="cite">+};<br></blockquote><blockquote type="cite">+static int arr13_offset[(offsetof(struct t13, bar) == 4) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr13_sizeof[(sizeof(struct t13) == 8) ? 0 : -1];<br></blockquote><blockquote type="cite">+<br></blockquote><blockquote type="cite">+struct t14<br></blockquote><blockquote type="cite">+{<br></blockquote><blockquote type="cite">+  char foo1;<br></blockquote><blockquote type="cite">+  int : 0;<br></blockquote><blockquote type="cite">+  char foo2 : 1;<br></blockquote><blockquote type="cite">+  short foo3 : 16;<br></blockquote><blockquote type="cite">+  char : 0;<br></blockquote><blockquote type="cite">+  short foo4 : 16;<br></blockquote><blockquote type="cite">+  char bar1;<br></blockquote><blockquote type="cite">+  int : 0;<br></blockquote><blockquote type="cite">+  char bar2;<br></blockquote><blockquote type="cite">+};<br></blockquote><blockquote type="cite">+static int arr14_bar1_offset[(offsetof(struct t14, bar1) == 10) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr14_bar2_offset[(offsetof(struct t14, bar2) == 12) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr14_sizeof[(sizeof(struct t14) == 16) ? 0 : -1];<br></blockquote><blockquote type="cite">+<br></blockquote><blockquote type="cite">+struct t15<br></blockquote><blockquote type="cite">+{<br></blockquote><blockquote type="cite">+  char foo;<br></blockquote><blockquote type="cite">+  char : 0;<br></blockquote><blockquote type="cite">+  int : 0;<br></blockquote><blockquote type="cite">+  char bar;<br></blockquote><blockquote type="cite">+  long : 0;<br></blockquote><blockquote type="cite">+  char : 0;<br></blockquote><blockquote type="cite">+};<br></blockquote><blockquote type="cite">+static int arr15_offset[(offsetof(struct t15, bar) == 4) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr15_sizeof[(sizeof(struct t15) == 8) ? 0 : -1];<br></blockquote><blockquote type="cite">+<br></blockquote><blockquote type="cite">+struct t16<br></blockquote><blockquote type="cite">+{<br></blockquote><blockquote type="cite">+  long : 0;<br></blockquote><blockquote type="cite">+  char bar;<br></blockquote><blockquote type="cite">+};<br></blockquote><blockquote type="cite">+static int arr16_offset[(offsetof(struct t16, bar) == 0) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr16_sizeof[(sizeof(struct t16) == 4) ? 0 : -1];<br></blockquote><blockquote type="cite">+<br></blockquote><blockquote type="cite">+struct t17<br></blockquote><blockquote type="cite">+{<br></blockquote><blockquote type="cite">+  char foo;<br></blockquote><blockquote type="cite">+  long : 0;<br></blockquote><blockquote type="cite">+  long : 0;<br></blockquote><blockquote type="cite">+  char : 0;<br></blockquote><blockquote type="cite">+  char bar;<br></blockquote><blockquote type="cite">+};<br></blockquote><blockquote type="cite">+static int arr17_offset[(offsetof(struct t17, bar) == 4) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr17_sizeof[(sizeof(struct t17) == 8) ? 0 : -1];<br></blockquote><blockquote type="cite">+<br></blockquote><blockquote type="cite">+struct t18<br></blockquote><blockquote type="cite">+{<br></blockquote><blockquote type="cite">+  long : 0;<br></blockquote><blockquote type="cite">+  long : 0;<br></blockquote><blockquote type="cite">+  char : 0;<br></blockquote><blockquote type="cite">+};<br></blockquote><blockquote type="cite">+static int arr18_sizeof[(sizeof(struct t18) == 0) ? 0 : -1];<br></blockquote><blockquote type="cite">+<br></blockquote><blockquote type="cite">+struct t19<br></blockquote><blockquote type="cite">+{<br></blockquote><blockquote type="cite">+  char foo1;<br></blockquote><blockquote type="cite">+  long foo2 : 1;<br></blockquote><blockquote type="cite">+  char : 0;<br></blockquote><blockquote type="cite">+  long foo3 : 32;<br></blockquote><blockquote type="cite">+  char bar;<br></blockquote><blockquote type="cite">+};<br></blockquote><blockquote type="cite">+static int arr19_offset[(offsetof(struct t19, bar) == 8) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr19_sizeof[(sizeof(struct t19) == 12) ? 0 : -1];<br></blockquote><blockquote type="cite">+<br></blockquote><blockquote type="cite">+struct t20<br></blockquote><blockquote type="cite">+{<br></blockquote><blockquote type="cite">+  short : 0;<br></blockquote><blockquote type="cite">+  int foo : 1;<br></blockquote><blockquote type="cite">+  long : 0;<br></blockquote><blockquote type="cite">+  char bar;<br></blockquote><blockquote type="cite">+};<br></blockquote><blockquote type="cite">+static int arr20_offset[(offsetof(struct t20, bar) == 4) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr20_sizeof[(sizeof(struct t20) == 8) ? 0 : -1];<br></blockquote><blockquote type="cite">+<br></blockquote><blockquote type="cite">+struct t21<br></blockquote><blockquote type="cite">+{<br></blockquote><blockquote type="cite">+  short : 0;<br></blockquote><blockquote type="cite">+  int foo1 : 1;<br></blockquote><blockquote type="cite">+  char : 0;<br></blockquote><blockquote type="cite">+  int foo2 : 16;<br></blockquote><blockquote type="cite">+  long : 0;<br></blockquote><blockquote type="cite">+  char bar1;<br></blockquote><blockquote type="cite">+  int bar2;<br></blockquote><blockquote type="cite">+  long bar3;<br></blockquote><blockquote type="cite">+  char foo3 : 8;<br></blockquote><blockquote type="cite">+  char : 0;<br></blockquote><blockquote type="cite">+  long : 0;<br></blockquote><blockquote type="cite">+  int foo4 : 32;<br></blockquote><blockquote type="cite">+  short foo5: 1;<br></blockquote><blockquote type="cite">+  long bar4;<br></blockquote><blockquote type="cite">+  short foo6: 16;<br></blockquote><blockquote type="cite">+  short foo7: 16;<br></blockquote><blockquote type="cite">+  short foo8: 16;<br></blockquote><blockquote type="cite">+};<br></blockquote><blockquote type="cite">+static int arr21_bar1_offset[(offsetof(struct t21, bar1) == 8) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr21_bar2_offset[(offsetof(struct t21, bar2) == 12) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr21_bar3_offset[(offsetof(struct t21, bar3) == 16) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr21_bar4_offset[(offsetof(struct t21, bar4) == 32) ? 0 : -1];<br></blockquote><blockquote type="cite">+static int arr21_sizeof[(sizeof(struct t21) == 44) ? 0 : -1];<br></blockquote><blockquote type="cite">+<br></blockquote><blockquote type="cite">int main() {<br></blockquote><blockquote type="cite">  return 0;<br></blockquote><blockquote type="cite">}<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">cfe-commits mailing list<br></blockquote><blockquote type="cite"><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br></blockquote><blockquote type="cite"><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br></blockquote><br></div></blockquote></div><br></body></html>