From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10620 invoked by alias); 15 May 2011 22:26:48 -0000 Received: (qmail 10612 invoked by uid 22791); 15 May 2011 22:26:48 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 15 May 2011 22:26:34 +0000 From: "janus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/48700] memory leak with MOVE_ALLOC X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: janus at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: janus at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Sun, 15 May 2011 22:32:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg01219.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48700 --- Comment #6 from janus at gcc dot gnu.org 2011-05-15 22:05:00 UTC --- The patch in comment #5 regtests cleanly. But apparently there is also a problem with MOVE_ALLOC and allocatable arrays: program testmv3 type bar integer, allocatable :: ia(:), ja(:) end type type(bar), allocatable :: sm(:),sm2(:) allocate(sm(1)) allocate(sm(1)%ia(10),sm(1)%ja(10)) call move_alloc(sm2,sm) end program testmv3 valgrind shows that the allocatable components are not being freed: ==21249== 40 bytes in 1 blocks are definitely lost in loss record 1 of 2 ==21249== at 0x4C2683D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==21249== by 0x400B8F: MAIN__ (arr.f90:10) ==21249== by 0x400FE6: main (arr.f90:14) ==21249== ==21249== 40 bytes in 1 blocks are definitely lost in loss record 2 of 2 ==21249== at 0x4C2683D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==21249== by 0x400CF4: MAIN__ (arr.f90:10) ==21249== by 0x400FE6: main (arr.f90:14)