[Bug fortran/122386] Wrong code with TRANSFER of subarray component references
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Oct 24 17:18:34 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122386
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:2febf3b968329aceeeea7805af98ed98a8c67e75
commit r16-4611-g2febf3b968329aceeeea7805af98ed98a8c67e75
Author: Harald Anlauf <anlauf@gmx.de>
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.
More information about the Gcc-bugs
mailing list