https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87352
--- Comment #15 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- Author: tkoenig Date: Sat Apr 6 22:10:28 2019 New Revision: 270184 URL: https://gcc.gnu.org/viewcvs?rev=270184&root=gcc&view=rev Log: 2019-04-06 Thomas Koenig <tkoe...@gcc.gnu.org> PR fortran/87352 * gfortran.h (gfc_component): Add finalized field. * class.c (finalize_component): If the component is already finalized, return early. Set component->finalized on exit. 2019-04-06 Thomas Koenig <tkoe...@gcc.gnu.org> PR fortran/87352 * gfortran.dg/finalize_28.f90: Adjust count of __builtin_free. * gfortran.dg/finalize_33.f90: Likewise. * gfortran.dg/finalize_34.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/finalize_34.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/class.c trunk/gcc/fortran/gfortran.h trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/finalize_28.f90 trunk/gcc/testsuite/gfortran.dg/finalize_33.f90