[clang] [clang][AST] Fix assertion on AIX when ms_struct aligns a double (PR #219661)

Hubert Tong via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 29 10:46:28 PDT 2026


================
@@ -1996,9 +1996,9 @@ void ItaniumRecordLayoutBuilder::LayoutField(const FieldDecl *D,
     auto performBuiltinTypeAlignmentUpgrade = [&](const BuiltinType *BTy) {
       if (BTy->getKind() == BuiltinType::Double ||
           BTy->getKind() == BuiltinType::LongDouble) {
-        assert(PreferredAlign == CharUnits::fromQuantity(4) &&
-               "No need to upgrade the alignment value.");
-        PreferredAlign = CharUnits::fromQuantity(8);
+        if (PreferredAlign == CharUnits::fromQuantity(4)) {
+          PreferredAlign = CharUnits::fromQuantity(8);
+        }
----------------
hubert-reinterpretcast wrote:

It appears this change is being made in an effort to support the problematic status quo (see https://github.com/llvm/llvm-project/pull/219661/changes#r3887214897). This change should not be made without further supporting analysis of whether it is necessary if the underlying problems are addressed.

https://github.com/llvm/llvm-project/pull/219661


More information about the cfe-commits mailing list