This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32795] Leaking memory (generated prog) with type constructor & allocatable components
- From: "dfranke at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jul 2007 21:42:57 -0000
- Subject: [Bug fortran/32795] Leaking memory (generated prog) with type constructor & allocatable components
- References: <bug-32795-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from dfranke at gcc dot gnu dot org 2007-07-17 21:42 -------
After update to r126703, updated example from pr31320, comment #4:
type :: a
integer, allocatable :: i(:)
end type a
type(a) :: x, y
x = a ((/ 1,2,3 /))
! y = a (x%i(1:3)) ! ok
! y = a (x%i(1:)) ! ok
! y = a (x%i(:3)) ! ok
! y = a (x%i(:)) ! memory leak
! y = a (x%i) ! memory leak
! y = x ! ok
end
==21521== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 7 from 1)
==21521== malloc/free: in use at exit: 12 bytes in 1 blocks.
==21521== malloc/free: 12 allocs, 11 frees, 25,539 bytes allocated.
==21521== For counts of detected errors, rerun with: -v
==21521== searching for pointers to 1 not-freed blocks.
==21521== checked 66,236 bytes.
==21521==
==21521== 12 bytes in 1 blocks are definitely lost in loss record 1 of 1
==21521== at 0x40215CD: malloc (vg_replace_malloc.c:149)
==21521== by 0x80486CC: MAIN__ (in /home/daniel/pr/a.out)
==21521== by 0x8048958: main (fmain.c:22)
--
dfranke at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dfranke at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32795