This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/41586] New: [OOP] Allocatable _scalar_ TYPE/CLASS leak memory
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Oct 2009 13:26:57 -0000
- Subject: [Bug fortran/41586] New: [OOP] Allocatable _scalar_ TYPE/CLASS leak memory
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
(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