From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10944 invoked by alias); 27 Apr 2014 14:47:42 -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 Received: (qmail 10899 invoked by uid 48); 27 Apr 2014 14:47:39 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/41936] Memory leakage with allocatables and user-defined operators Date: Sun, 27 Apr 2014 14:47:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.5.0 X-Bugzilla-Keywords: patch, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pault at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-04/txt/msg02014.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41936 --- Comment #5 from Dominique d'Humieres --- > Calling gfc_deallocate_alloc_comp for BT_CLASS looks wrong. ... I have only added " && expr->rank" to the three year old Mikael's patch. > You have to call the finalization wrapper - to ensure that not only the > allocatable components of the declared type but also the ones of the > effective/actual type are deallocated. Additionally, that ensure that > user's finalizer is called when it exists. > > (For BT_DERIVED, you may also have to call the finalization wrapper - but only > if the type has finalizers.) Could you please provide a more explicit pointer?