From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20147 invoked by alias); 7 May 2012 10:11:26 -0000 Received: (qmail 20134 invoked by uid 22791); 7 May 2012 10:11:25 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED 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; Mon, 07 May 2012 10:11:13 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/37336] Fortran 2003: Finish derived-type finalization Date: Mon, 07 May 2012 10:20: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-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status AssignedTo 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 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: 2012-05/txt/msg00705.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW AssignedTo|domob at gcc dot gnu.org |unassigned at gcc dot | |gnu.org --- Comment #10 from Tobias Burnus 2012-05-07 10:09:52 UTC --- Regarding FINAL but also normal deallocation - including polymorphic deallocation: Variables with the SAVE attribute shouldn't be automatically deallocated. That includes variables of the main program which are implicitly SAVE! Currently, gfortran deallocates them automatically, which is nice for "valgrind" results - and not detectable by the program. However, with FINAL - but also for allocatable coarrays (except -fcoarray=single) - one cannot do it. Coarrays might be still accessed from other images while FINAL shouldn't be called - thus a simple 'print *, "gotcha"' in FINAL would be able to detect this. Note: A normal freeing for noncoarrays, including polymorphic freeing, would be still possible if one simply skips all FINAL calls. At least I do not see how that should be detectable from within the program.