From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18942 invoked by alias); 13 Oct 2010 13:22:36 -0000 Received: (qmail 18932 invoked by uid 22791); 13 Oct 2010 13:22:35 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,MISSING_MID 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; Wed, 13 Oct 2010 13:22:21 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/42647] Missed initialization/dealloc of allocatable scalar DT with allocatable component X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal 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: 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: Wed, 13 Oct 2010 13:22: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: 2010-10/txt/msg01085.txt.bz2 Message-ID: <20101013132200.nl3BB8esd1A09RcYbZDm1yeUGXN0dOPWIdBleLaTwhM@z> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42647 --- Comment #11 from Tobias Burnus 2010-10-13 13:21:40 UTC --- (In reply to comment #10) > allocate(a1, a1%b1, a1%b1%c1) This ALLOCATE statement is INVALID! It violates the following: "An allocate-object [...] shall not depend [...] on the [...] allocation status [...] of any allocate-object in the same ALLOCATE statement." (F2008, "6.7.1 ALLOCATE statement" first paragraph after C644.) Solution: Write it as allocate(a1) allocate(a1%b1) allocate(a1%b1%c1) The test case still fails: For the DEALLOCATE statement one wrongly gets the error that the variable is not allocated. * * * Cf. also Janus' patch for this PR (which does not yet fix this DEALLOCATE issue): http://gcc.gnu.org/ml/fortran/2010-10/msg00155.html