[-Ping-, Fortran, Patch, PR116669, v3] Fix ICE in deallocation of derived types having cyclic dependencies
Andre Vehreschild
vehre@gmx.de
Mon Jan 6 14:21:18 GMT 2025
Hi all,
during looking for something completely different, I figured, that gcc does not
use std::set internally, but its implementation of hash_set. I therefore
adapted the patch to use it. Nothing more changed.
Still regtests ok on x86_64-pc-linux-gnu / F41. Ok for mainline?
Regards,
Andre
On Mon, 6 Jan 2025 11:06:46 +0100
Andre Vehreschild <vehre@gmx.de> wrote:
> Hi all,
>
> pinging attached rebased patch.
>
> Regtests ok on x86_64-pc-linux-gnu / F41. Ok for mainline?
>
> - Andre
>
> On Thu, 12 Dec 2024 14:50:13 +0100
> Andre Vehreschild <vehre@gmx.de> wrote:
>
> > Hi all,
> >
> > attached patch improves analysis of cycles in derived types, i.e. type
> > dependencies ala:
> >
> > type(T)
> > type(T2), allocatable :: c
> > end type
> >
> > type(T2)
> > type(T), allocatable :: t
> > end type
> >
> > are now detected and deallocating an object that is of any of the types
> > now no longer crashes the compiler because of an endless recursion. To
> > accomplish this, I stored the symbols of the types seen in a C++ set
> > and checked if a component's type is already present in there. When a
> > type has such an indirect self-reference, it gets marked by setting its
> > symbol_attribute::recursive flag. Later steps then can make use of it.
> >
> > Furthermore are _deallocate members of the vtab populated when a type
> > has the recursive and the alloc_comp flag set.
> >
> > Bootstraps and regtests ok on x86_64-pc-linux-gnu / F41. Ok for
> > mainline?
> >
> > Note: The patch was developed on top of my coarray patch, but should
> > apply with delta on a regular trunk w/o issues.
> >
> > Regards,
> > Andre
> > --
> > Andre Vehreschild * Email: vehre ad gcc dot gnu dot org
>
>
> --
> Andre Vehreschild * Email: vehre ad gmx dot de
--
Andre Vehreschild * Email: vehre ad gmx dot de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr116669_3.patch
Type: text/x-patch
Size: 12927 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20250106/715fc00a/attachment.bin>
More information about the Fortran
mailing list