[Bug fortran/123938] [16 Regression] Memory leak on assignment

albert at tugraz dot at via Gcc-bugs <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.