[flang-commits] [flang] [flang] Fix TRANSFER into derived type with tail padding zeroing pad bytes (PR #223814)

via flang-commits flang-commits at lists.llvm.org
Thu Sep 17 19:52:45 PDT 2026


================
@@ -151,3 +151,24 @@ subroutine trans_test_alloc_source(store, src)
     real, allocatable :: src
     store = transfer(src, store)
   end subroutine
+
+  ! TRANSFER into a SEQUENCE derived type with tail padding: the assignment back
+  ! to the derived-type variable must use fir.copy (full storage size including
+  ! tail padding) rather than a field-by-field copy that silently drops padding.
+  subroutine trans_test_seq_tail_pad(raw, x)
+    ! CHECK-LABEL: func @_QPtrans_test_seq_tail_pad(
+    ! CHECK:         fir.call @_FortranATransfer(
----------------
MattPD wrote:

The new FIR check fails on the component-by-component output from [the PR's original base](https://github.com/llvm/llvm-project/commit/de9ad513460a1a5439b0b8d6d5c7a51a3634bc20).

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


More information about the flang-commits mailing list