public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/32795]  New: Leaking memory (generated prog) with type constructor & allocatable components
@ 2007-07-17 17:57 burnus at gcc dot gnu dot org
  2007-07-17 21:43 ` [Bug fortran/32795] " dfranke at gcc dot gnu dot org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-07-17 17:57 UTC (permalink / raw)
  To: gcc-bugs

Taken from my remark to PR31320,
http://gcc.gnu.org/ml/gcc-patches/2007-07/msg01457.html

The generated executable leaks memory:

 96 bytes in 1 blocks are definitely lost in loss record 1 of 2
    at 0x4C22D06: malloc (in
/usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
    by 0x40122B: MAIN__ (alloc_comp_assign_2.f90:11)
    by 0x401EEB: main (fmain.c:22)

 96 bytes in 1 blocks are definitely lost in loss record 2 of 2
    at 0x4C22D06: malloc (in
/usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
    by 0x400BCA: MAIN__ (alloc_comp_assign_2.f90:10)
    by 0x401EEB: main (fmain.c:22)


for this stripped down test case

  type :: a
    integer, allocatable :: i(:)
  end type a
  type :: b
    type (a), allocatable :: at(:)
  end type b
  type(a) :: x(2)
  type(b) :: y(2)
  integer i
  y(1) = b ((/x(1),x(2)/))
  y(2) = b ((/x(2),x(1)/))
  forall (i=1:2) y(i) = b ((/x(i)/))
end

Paul remarked:
The testcase that you sent me breaks gfortran in other places and probably
should have a PR all of its very own.  (try the FORALL part separately).


-- 
           Summary: Leaking memory (generated prog) with type constructor &
                    allocatable components
           Product: gcc
           Version: 4.3.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=32795


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2008-11-29 21:58 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-17 17:57 [Bug fortran/32795] New: Leaking memory (generated prog) with type constructor & allocatable components burnus at gcc dot gnu dot org
2007-07-17 21:43 ` [Bug fortran/32795] " dfranke at gcc dot gnu dot org
2007-07-18 17:12 ` [Bug fortran/32795] [4.3 regression] allocatable components are nullified prematurely dfranke at gcc dot gnu dot org
2007-07-18 17:47 ` [Bug fortran/32795] " dfranke at gcc dot gnu dot org
2007-07-28 20:52 ` pault at gcc dot gnu dot org
2007-08-01 18:39 ` burnus at gcc dot gnu dot org
2008-01-30 22:30 ` burnus at gcc dot gnu dot org
2008-02-07 15:19 ` pault at gcc dot gnu dot org
2008-02-07 17:25 ` dfranke at gcc dot gnu dot org
2008-02-07 19:53 ` dominiq at lps dot ens dot fr
2008-02-07 22:05 ` pault at gcc dot gnu dot org
2008-02-07 22:10 ` dfranke at gcc dot gnu dot org
2008-02-07 22:17 ` burnus at gcc dot gnu dot org
2008-02-07 22:30 ` dfranke at gcc dot gnu dot org
2008-02-19 12:12 ` pault at gcc dot gnu dot org
2008-11-24  6:37 ` pault at gcc dot gnu dot org
2008-11-27 13:26 ` burnus at gcc dot gnu dot org
2008-11-29 20:45 ` pault at gcc dot gnu dot org
2008-11-29 21:58 ` pault at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).