https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90068
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Andre Vehreschild <ve...@gcc.gnu.org>: https://gcc.gnu.org/g:c3190756487080a11e819746f00b6e30fd0a0c2e commit r15-1094-gc3190756487080a11e819746f00b6e30fd0a0c2e Author: Andre Vehreschild <ve...@gcc.gnu.org> Date: Thu Jul 27 14:51:34 2023 +0200 Add finalizer creation to array constructor for functions of derived type. PR fortran/90068 gcc/fortran/ChangeLog: * trans-array.cc (gfc_trans_array_ctor_element): Eval non- variable expressions once only. (gfc_trans_array_constructor_value): Add statements of final block. (trans_array_constructor): Detect when final block is required. gcc/testsuite/ChangeLog: * gfortran.dg/finalize_57.f90: New test.