This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/80121] Memory leak with derived-type intent(out) argument


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]