https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120637
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by Andre Vehreschild <[email protected]>: https://gcc.gnu.org/g:1cb95b3006dd615a03d3e4bade5605532c4ab65e commit r15-9978-g1cb95b3006dd615a03d3e4bade5605532c4ab65e Author: Andre Vehreschild <[email protected]> Date: Wed Jun 25 14:46:16 2025 +0200 Fortran: Ensure finalizers are created correctly [PR120637] Finalize_component freeed an expression that it used to remember which components in which context it had finalized already. While it makes sense to free the copy of the expression, if it is unused, it causes issues, when comparing to a non existent expression. This is now detected by returning true, when the expression has been used. PR fortran/120637 gcc/fortran/ChangeLog: * class.cc (finalize_component): Return true, when a finalizable component was detect and do not free it. gcc/testsuite/ChangeLog: * gfortran.dg/asan/finalize_1.f90: New test. (cherry picked from commit d1f05661fa6c8a6ea6f59ad365a84469100e425e)
