[Bug fortran/93691] Type bound assignment causes too many finalization of derived type when part of other type

pault at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Mar 18 17:25:36 GMT 2023


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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
                 CC|                            |pault at gcc dot gnu.org

--- Comment #4 from Paul Thomas <pault at gcc dot gnu.org> ---
Hi Florian,

I am closing this as fixed, even though it runs to the third finalization and
then segfaults, because both nagfor and ifort behave in the same way.

The dump of the code shows that Outer2 is finalized before the assignment and
that both Outer1 and Outer2 are finalized on leaving the block scope. Thus,
alll is as it should be.

Default initializing icount to NULL(), guarding for unassociated icount in
deleteIt gets rid of the segfault.

Thanks for the report.

Paul


More information about the Gcc-bugs mailing list