This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/80121] Memory leak with derived-type intent(out) argument
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 15 Apr 2017 18:29:32 +0000
- Subject: [Bug fortran/80121] Memory leak with derived-type intent(out) argument
- Auto-submitted: auto-generated
- References: <bug-80121-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80121
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
CC| |janus at gcc dot gnu.org
Summary|Memory leak when allocating |Memory leak with
|a component derived type in |derived-type intent(out)
|a recursive subroutine |argument
|(gfortran) |
--- Comment #3 from janus at gcc dot gnu.org ---
Here is a reduced/modified test case (without recursion):
PROGRAM p
IMPLICIT NONE
TYPE t1
INTEGER, ALLOCATABLE :: i(:)
END TYPE
call leak
CONTAINS
SUBROUTINE s1(e)
TYPE(t1), ALLOCATABLE, INTENT(OUT) :: e(:)
ALLOCATE( e(1) )
ALLOCATE( e(1)%i(2) )
END SUBROUTINE
SUBROUTINE leak
TYPE(t1), ALLOCATABLE :: e(:)
CALL s1(e)
CALL s1(e)
END SUBROUTINE
END PROGRAM