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/41586] New: [OOP] Allocatable _scalar_ TYPE/CLASS leak memory


(Cf. also PR 41585)

type t0
end type t0
type t
  integer :: i
  class(t0), allocatable :: foo
end type t
type(t) :: m
allocate(t0 :: m%foo)
m%i = 5
end

leaks memory:

    D.1375 = (void * restrict) __builtin_malloc (1);
    m.foo.$data = (struct t0 *) D.1375;
  m.foo.$vindex = 1;
  m.i = 5;
}


SAME FOR:

type t0
end type t0
class(t0), allocatable :: m
allocate(t0 :: m)
end

AND ALSO FOR:

type t0
end type t0
type(t0), allocatable :: m(:)
allocate(t0 :: m(3))
end


-- 
           Summary: [OOP] Allocatable _scalar_ TYPE/CLASS leak memory
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41586


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