[Bug fortran/86481] Memory leak with nested sourced allocations
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Jul 29 00:04:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86481
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |janus at gcc dot gnu.org
--- Comment #3 from janus at gcc dot gnu.org ---
Here is the simplest reduction of the test case that I could find:
program simple_leak
implicit none
type :: foo_t
end type
class(foo_t), allocatable :: f
allocate(f, SOURCE=func_foo())
contains
function func_foo () result (f)
class(foo_t), allocatable :: f
allocate(foo_t :: f)
end function
end
It leaks a lot less, though:
==27446== HEAP SUMMARY:
==27446== in use at exit: 2 bytes in 2 blocks
==27446== total heap usage: 23 allocs, 21 frees, 13,562 bytes allocated
==27446==
==27446== 1 bytes in 1 blocks are definitely lost in loss record 2 of 2
More information about the Gcc-bugs
mailing list