From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c4cb2c432feebd9d X-Google-Thread: 1094ba,c4cb2c432feebd9d X-Google-Attributes: gid103376,gid1094ba,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!arclight.uoregon.edu!feednews.vanderbilt.edu!feed.news.qwest.net!nems.noaa.gov!not-for-mail From: Paul Van Delst Newsgroups: comp.lang.ada,comp.lang.fortran Subject: Re: Bounds Check Overhead Date: Fri, 26 May 2006 15:23:22 -0400 Organization: CIMSS@NOAA/NCEP/EMC Message-ID: References: <0ugu4e.4i7.ln@hunter.axlog.fr> <%P_cg.155733$eR6.26337@bgtnsc04-news.ops.worldnet.att.net> <6H9dg.10258$S7.9150@news-server.bigpond.net.au> <1hfv5wb.1x4ab1tbdzk7eN%nospam@see.signature> <4475DA61.3080001@comcast.net> <44762F55.4050106@cits1.stanford.edu> <87hd3d1472.fsf@ludovic-brenta.org> <1hfxsjh.t88mchrssv9cN%nospam@see.signature> <1hfxy4r.1sv2j76l6cgg1N%nospam@see.signature> NNTP-Posting-Host: lnx374.ncep.noaa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.nems.noaa.gov 1148674533 1103 140.90.192.92 (26 May 2006 20:15:33 GMT) X-Complaints-To: postmaster@noaa.gov NNTP-Posting-Date: Fri, 26 May 2006 20:15:33 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0.8-1.4.1 (X11/20060420) X-Accept-Language: en-us, en In-Reply-To: <1hfxy4r.1sv2j76l6cgg1N%nospam@see.signature> Xref: g2news2.google.com comp.lang.ada:4510 comp.lang.fortran:10309 Date: 2006-05-26T15:23:22-04:00 List-Id: Richard Maine wrote: > Nasser Abbasi wrote: > > >> >> >>I am not sure if there is supposed to compiler flag to enforce this or not, > > > I said > > >>Compilers are not required to enforce that rule, > > > (In context, I meant Fortran compilers, as I do in all cases below.) In > terms of the standard, that is basically all there is to say. As I tried > to elaborate, almost all compilers do enforce simpe cases. I don't know > of a compiler that doesn't. However, that has nothing to do with any > requirement of the standard. > > The standard has nothing at all to say about compiler switches in any > context. That is not a concept defined by the standard. > > >>so I did this very simple test, > > > > No, this is not a simple test. This is one of the complicated cases. The > code is short, but that doesn't necessarily mean simple to diagnose. For the OP, here's both cases, and the simple one is caught: PROGRAM testit IMPLICIT NONE INTEGER :: i DO i=1,10 CALL foo(i) ! The complicated case PRINT *,i i = i+2 ! The simple case PRINT *,i END DO CONTAINS SUBROUTINE foo(i) INTEGER,INTENT(IN OUT) :: i i=i+1 END SUBROUTINE foo END PROGRAM testit lnx:scratch : gfortran testit.f90 In file testit.f90:7 i = i+2 1 In file testit.f90:4 DO i=1,10 2 Error: Variable 'i' at (1) cannot be redefined inside loop beginning at (2) (g95, lf95, and pgf95 give essentially the same error message.) cheers, paulv -- Paul van Delst Ride lots. CIMSS @ NOAA/NCEP/EMC Eddy Merckx Ph: (301)763-8000 x7748 Fax:(301)763-8545