[PATCH] D79719: [AIX] Implement AIX special alignment rule about double/long double

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 21 14:18:25 PDT 2020


hubert.reinterpretcast added inline comments.


================
Comment at: clang/lib/AST/RecordLayoutBuilder.cpp:1887
+      if (BTy->isFloatingPoint()) {
+        PreferredAlign = FieldSize;
+      }
----------------
I tried `clang -cc1 -triple powerpc-ibm-aix -fsyntax-only` with
<stdin>:
```
struct A {
  struct B {
    double d[3];
  } b;
};

extern char x[__alignof__(struct A)];
extern char x[8];
```

I got an assertion failure:
```
clang: /src/clang/lib/AST/RecordLayoutBuilder.cpp:2078: void {anonymous}::ItaniumRecordLayoutBuilder::UpdateAlignment(clang::CharUnits, clang::CharUnits, clang::CharUnits): Assertion `llvm::isPowerOf2_64(PreferredNewAlignment.getQuantity()) && "Alignment not a power of 2"' failed.
```



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79719/new/

https://reviews.llvm.org/D79719





More information about the cfe-commits mailing list