------- Comment #13 from dfranke at gcc dot gnu dot org 2008-02-07 22:30
-------
> As valgrind --leak-check=full shows, the generated program still
> leaks memory
Forgot to check this one :(
Interestingly, the error seems to be with forall only.
The equivalent DO-loop does not leak:
type :: a
integer, allocatable :: i(:)
end type a
type :: b
type (a), allocatable :: at(:)
end type b
type(a) :: x(2)
type(b) :: y(2)
integer i
y(1) = b ((/x(1),x(2)/))
y(2) = b ((/x(2),x(1)/))
! forall (i=1:2) y(i) = b ((/x(i)/)) ! memory leak (12 of 14)
DO i = 1,2 ! frees 14 of 14
y(i) = b ((/x(i)/))
END DO
end
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32795