https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123483

--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jerry DeLisle <[email protected]>:

https://gcc.gnu.org/g:b405a04ffde07e9a3021b74a5d40c7938984b88f

commit r16-6656-gb405a04ffde07e9a3021b74a5d40c7938984b88f
Author: Jerry DeLisle <[email protected]>
Date:   Fri Jan 9 09:38:52 2026 -0800

    Fortran: [PR123483] Fix duplicate finalization

    A duplicated call to a finalizer occured in cases where a derived type
    has components, one or more of which are allocatable, and one or more
    of which are finalizable. (The bug occured only if the derived type
    is an extension of another type, which has defined assignment.)

    New test case derived from the original report by Paul Thomas.

            PR fortran/123483

    gcc/fortran/ChangeLog:

            * trans-array.cc (gfc_deallocate_alloc_comp): Ad the new
            finalization argument and pass it to structure_alloc_comps.
            * trans-array.h (gfc_deallocate_alloc_comp): Add a finalization
            flag that can be passed by gfc_conv_procedure_call.
            * trans-expr.cc (gfc_conv_procedure_call): Use the new
            finalization flag.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/finalize_61.f90: New test.

            Signed off by: Andrew Benson <[email protected]>

Reply via email to