https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122386
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by Harald Anlauf <[email protected]>: https://gcc.gnu.org/g:696bfbab0a46ccc263cffd88254582d236a84278 commit r15-10471-g696bfbab0a46ccc263cffd88254582d236a84278 Author: Harald Anlauf <[email protected]> Date: Thu Oct 23 21:21:04 2025 +0200 Fortran: fix TRANSFER of subarray component references [PR122386] Commit r16-518 introduced a change that fixed inquiry references of complex arrays as argument to the TRANSFER intrinsic by forcing a temporary. The solution taken however turned out not to be generalizable to component references of nested derived-type arrays. A better way is the revert that patch and force the generation of a temporary when the SOURCE expression is a not simply-contiguous array. PR fortran/122386 gcc/fortran/ChangeLog: * dependency.cc (gfc_ref_needs_temporary_p): Revert r16-518. * trans-intrinsic.cc (gfc_conv_intrinsic_transfer): Force temporary for SOURCE not being a simply-contiguous array. gcc/testsuite/ChangeLog: * gfortran.dg/transfer_array_subref_2.f90: New test. (cherry picked from commit 2febf3b968329aceeeea7805af98ed98a8c67e75)
