]> git.ipfire.org Git - thirdparty/gcc.git/commit
fortran: [PR121628]
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 8 Nov 2025 02:46:54 +0000 (18:46 -0800)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 8 Nov 2025 02:56:38 +0000 (18:56 -0800)
commita1fe2cfa8965ac298f6541d46b90156b1cb34726
tree49da8ac2204bd9ac237920883fbacd6b298fe1ba
parent77e10b47f25d05d51a187822fe6a8366a6d68d67
fortran: [PR121628]

The PR121628 deep-copy helper reused a static seen_derived_types set
across wrapper generation, so recursive allocatable arrays that appeared
multiple times in a derived type caused infinite compile-time recursion.
Save and restore the set around each wrapper build, polish follow-ups,
and add a regression test to keep the scenario covered.

gcc/fortran/ChangeLog:

PR fortran/121628
* trans-array.cc (seen_derived_types): Move to file scope and
preserve/restore around generate_element_copy_wrapper.
* trans-intrinsic.cc (conv_intrinsic_atomic_op): Reuse
gfc_trans_force_lval when forcing addressable CAF temps.

gcc/testsuite/ChangeLog:

PR fortran/121628
* gfortran.dg/alloc_comp_deep_copy_7.f90: New test.

libgfortran/ChangeLog:

PR fortran/121628
* Makefile.in: Keep continuation indentation within 80 columns.
* aclocal.m4: Regenerate.
* libgfortran.h: Drop unused forward declaration.

Signed-off-by: Christopher Albert <albert@tugraz.at>
gcc/fortran/trans-array.cc
gcc/fortran/trans-intrinsic.cc
gcc/testsuite/gfortran.dg/alloc_comp_deep_copy_7.f90 [new file with mode: 0644]
libgfortran/Makefile.in
libgfortran/aclocal.m4
libgfortran/libgfortran.h