https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123938
Christopher Albert <albert at tugraz dot at> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |albert at tugraz dot at
--- Comment #10 from Christopher Albert <albert at tugraz dot at> ---
Open for review, comments welcome:
https://github.com/lazy-fortran/gcc/pull/40
Note on attachment 64493: it predates the pr125391.f90 testcase
(added 2026-05-23) and now regresses it; re-enabling finalization for
every derived temporary is too broad. The fix here records whether
argument conversion already scheduled finalization via
parmse.finalblock (as in Mikael's original check) and re-enables
dynamic finalization only for types with allocatable polymorphic
components, which is the case static deallocation cannot handle. With
that, pr123938 (valgrind: no leaks), pr125391 and finalize_61 all
pass, and check-fortran plus the libgomp Fortran suite are clean.