From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18998 invoked by alias); 2 Oct 2010 19:52:39 -0000 Received: (qmail 18987 invoked by uid 22791); 2 Oct 2010 19:52:38 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_40,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; Sat, 02 Oct 2010 19:52:33 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/45740] PROCEDURE POINTER and PROTECTED: Accepts/ICEs on invalid code X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus 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: 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: Sat, 02 Oct 2010 19:52: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/msg00251.txt.bz2 Message-ID: <20101002195200._HMyGSyP-bQB6_8Z-EAdLMX_SqsqeROJ7Oe9jlKpGvA@z> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45740 --- Comment #9 from Tobias Burnus 2010-10-02 19:52:17 UTC --- (In reply to comment #7) > Ok, I think the only way this half-sentence and the interpretation on the J3 > mailing list make sense, is via the following interpretation. I disagree and start to come to the conclusion that one should asked at the J3 mailing list - I just have no idea how to ask sensible for the proc-target part of C551. > Consider: > integer, pointer :: lhs, rhs > lhs => rhs > > In such a pointer assignment statement, the object on the right hand side > supposedly does not have the pointer attribute Why? I see on the right hand side a "data-target" looks perfectly like a pointer and matches also the definition "Entities with the POINTER attribute can be associated with different data objects or procedures during execution of a program." I could do: rhs => targer while (even if rhs were an array) I could not do rhs(4) => target > that 'lhs' will point to the target of 'rhs'). With this reading, C551 can be > applied to (proc-/data-)pointer assignments as well, and the sentence about > 'proc-target' does make sense. Well, it makes sense here - but you open at the same time the box of the Pandora. > Also, from a "common sense" POV, it is important to reject protected pointers > on the rhs of a pointer assignment, otherwise the PROTECTED feature could be > circumvented this way. Actually: How? I see how you can modify the pointer target - but not the pointer itself. Thus: - I think C551's "or proc-target" does not make sense as it is unreachable - With regards to C551/C552 gfortan handles it seemingly correctly - I need a stronger coffee when reading the fine prints of the Fortran standard With your definition, you allow for: pointer :: ptr2 => ptr1 which is difficult to get correct and I believe is invalid as "ptr1" has the POINTER and not the TARGET attribute. A POINTER is allowed for a normal, non-initialization expression.