[flang-commits] [flang] [flang] Fix `getTypeSizeAndAlignment` for packed/tail-padded `RecordType` and `TRANSFER` gate (PR #220377)

via flang-commits flang-commits at lists.llvm.org
Thu Sep 3 12:52:59 PDT 2026


================
@@ -0,0 +1,67 @@
+! RUN: %flang_fc1 -triple x86_64-unknown-linux-gnu -emit-hlfir %s -o - | FileCheck %s
+! REQUIRES: x86-registered-target
+
+! Regression test for https://github.com/llvm/llvm-project/pull/220377
+!
+! The TRANSFER inline gate compares store sizes, not allocation sizes.
+! Tail padding must not be included in the comparison.
+!
+! Types declared at module scope so that bare %flang_fc1 does not abort when
----------------
MattPD wrote:

At `eabf68933226`, the module-scoped `t2` case still contains `fir.embox` in HLFIR, so module scope does not avoid boxing in this case. The `transfer_rec_to_real10` routine lowers cleanly to LLVM IR when compiled alone. Only `transfer_rec_to_int8` fails because its descriptor is unavailable. Could the setup comment separate boxing from the descriptor failure without attributing boxing to declaration scope?


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


More information about the flang-commits mailing list