From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30193 invoked by alias); 12 Aug 2009 20:52:34 -0000 Received: (qmail 29493 invoked by uid 48); 12 Aug 2009 20:52:20 -0000 Date: Wed, 12 Aug 2009 20:52:00 -0000 Message-ID: <20090812205220.29492.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/31593] Invariant DO loop variables and subroutines In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "tobi at gcc dot gnu dot org" 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: 2009-08/txt/msg01063.txt.bz2 ------- Comment #9 from tobi at gcc dot gnu dot org 2009-08-12 20:52 ------- Side remark: DO i = 1,10 call bar(i) END DO wouldn't be valid if bar changed its argument, i.e. the compiler should generate the same, better code it does for the case where you copy the argument (bar((i))). I was worrying about the case where a whole array is passed as an argument, for a contrived example say: DO I=1,1000 DO J=1,1000 a(i,j) = i*j PRINT *, a ! don't want to copy all of a here END DO END DO The remark about OP_PARENTHESES was more about a clean implementation. Implementing this via OP_PARENTHESES would likely only be a few lines here and there, but it would be hackish as it would be workign around a deficiency further down. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31593