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

--- Comment #12 from Jeremy Sanders <jeremy at jeremysanders dot net> ---
Thomas - unfortunately I don't have a copy of what I did. I think reverting
this patch fixes the problem though:
https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/fortran/resolve.c?r1=254427&r2=254426&pathrev=254427

Sorry - I left out the allocate statements in the test case. Do you want me to
fix the test case?

I've not fixed the problem, but I've been putting debugging statements into the
code to try to understand what is going on. Please see the attached log file
and print patch.

What appears to happen is that generate_finalization_wrapper for
testmodule_Evtlistlist_type calls finalize_component for evtlistlist_type. This
in turn calls finalize_component for each member of evtlist_type. For N
members, N gfc_code objects are created (See the code pointers in the log).
Here my program has members p00, p01, p02 and p03.

When these code objects are then interpreted in gfc_trans_deallocate
structure_alloc_comps does a deallocation for each of the members. This leads
to the N^2 behaviour as the is a gfc_code object made for each member, and each
of these code objects does a deallocation of all members.

Reply via email to