https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128357
Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |jvdelisle at gcc dot
gnu.org
--- Comment #5 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
I had to do some head scratching on this.
Steve, you are right that two problems are mixed here; I will split
them. The wrong-code part is independent of any leak:
call sq ((q), zs)
passes q itself rather than a copy, so the dummy x aliases z and
changes when z is assigned (STOP 4 on trunk). Making a parenthesized
scalar CLASS variable produce a copy will get its own PR.
On the leaks I agree with Mikael: these are compiler temporaries that
live only for the call, not variables of the main program. With each
statement moved into a subroutine whose variables are all local, and
the subroutine called 1000 times, trunk loses:
call s ((ta)) 144,000 bytes in 1,000 blocks
(the array temporary itself)
call sc ((qa)) 12,000 bytes in 2,000 blocks
associate (b => (qa)) 12,000 bytes in 2,000 blocks
(allocatable components of the deep copies)
I will submit a patch for this one and open a new PR for the CLASS problem