From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1102 invoked by alias); 16 Jun 2011 12:01:26 -0000 Received: (qmail 1091 invoked by uid 22791); 16 Jun 2011 12:01:25 -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; Thu, 16 Jun 2011 12:01:12 +0000 From: "janus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/49436] Modifying actual arguments in subroutine not detected 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: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC 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" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Thu, 16 Jun 2011 12:01: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-06/txt/msg01433.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D49436 janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |janus at gcc dot gnu.org --- Comment #1 from janus at gcc dot gnu.org 2011-06-16 12:00:52 UTC --- (In reply to comment #0) > As I interpret it, the standard says that if an object passed as an actual > argument is also accessible in a subprogram through other means, then thi= s can > only be modified through the corresponding dummy argument (12.4.1.6). I guess you refer to this part: (2) If the value of any part of the entity is affected through the dummy argument, then at any time during the execution of the procedure, either be= fore or after the de=EF=AC=81nition, it may be referenced only through that dumm= y argument unless (a) the dummy argument has the POINTER attribute, (b) the part is all or part of a pointer subobject, or (c) the dummy argument has the TARGET attribute, the dummy argument does not have INTENT (IN), the dummy argument is a scalar object or an assumed-shape array, and the actual argument is a target other than an array section with= a vector subscript. And indeed I would interpret it in the same way as you do. However, the question is whether the standard requires the *compiler* to enforce this restriction, or if it is simply a restriction that the programmer is suppos= ed to follow. Are you aware of any compiler which enforces this restriction?