[PATCH] D23036: [SelectionDAG] Use a union of bitfield structs for SDNode::SubclassData.

Akira Hatanaka via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 19:25:16 PDT 2016


ahatanak added a subscriber: ahatanak.

================
Comment at: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h:1103
@@ -1040,1 +1102,3 @@
+                  "SDNodeBits field too small?");
+    return Data;
   }
----------------
I think this assert is not correct for some targets. sizeof(SDNodeBits) is equal to 1 if the target is "-arch armv7" because the alignment of class SDNodeBitfields is 1-byte. If you compile the following code with "-arch armv7", you'll see function foo1 returns 1.

```
class S1 {
  short HasDebugValue : 1;
  short IsMemIntrinsic : 1;
};

unsigned foo1() {
  S1 s1;
  return sizeof(s1);
}
```



Repository:
  rL LLVM

https://reviews.llvm.org/D23036





More information about the llvm-commits mailing list