[flang-commits] [flang] [flang] Fix RecordType sizes, TRANSFER lowering, and BIND(C) ABI on SystemZ/PPC64le (PR #220377)

via flang-commits flang-commits at lists.llvm.org
Fri Sep 4 23:33:11 PDT 2026


================
@@ -31,6 +31,48 @@ page](https://llvm.org/releases/).
 
 ## Bug Fixes
 
+- Fixed `fir::getTypeSizeAndAlignment` returning the wrong allocation size for
+  **packed derived types** (`SEQUENCE` types compiled with `PACK` / LLVM
+  packed-struct layout). Fields in a packed struct are placed back-to-back
+  using each component's allocation size (`alignTo(storeSize, ABIalign)`), not
+  its raw store size, and the struct ABI alignment is 1. For example, a packed
+  `{f80, i8}` on x86-64 now correctly reports 17 bytes instead of 11.
----------------
MattPD wrote:

Before the patch, the existing unpacked-size calculation already reported 17 bytes for `{f80, i8}` because it rounded `f80` to 16 bytes and added one byte for `i8`. The patch changes the reported alignment from 16 to 1. It changes `fir.box_elesize` from 32 to 17.

Could the release note use `{i32, f64}` instead? That example changes from 16 bytes to 12.

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


More information about the flang-commits mailing list