On 1/6/25 2:06 AM, Andre Vehreschild 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 <ve...@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?

This one is good to go.

Jerry


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

Reply via email to