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-Thread: 101deb,15c6ed4b761968e6 X-Google-Attributes: gid103376,gid1094ba,gid101deb,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news3.google.com!news.glorb.com!peer1.news.newnet.co.uk!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada,comp.lang.fortran,comp.lang.pl1 Subject: Re: Bounds Check Overhead Date: Thu, 25 May 2006 23:08:50 +0100 Organization: Pushface 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> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1148594936 27524 62.49.19.209 (25 May 2006 22:08:56 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Thu, 25 May 2006 22:08:56 +0000 (UTC) Cancel-Lock: sha1:ziT34FG5Ual69ZdFzBg7iehL68E= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news2.google.com comp.lang.ada:4475 comp.lang.fortran:10259 comp.lang.pl1:1722 Date: 2006-05-25T23:08:50+01:00 List-Id: Bob Lidral writes: > However, the performance hit of including explicit bounds checking > can be significant -- especially for code with extremely short loops > that are executed a lot of times. In Ada one should where possible use the 'Range attribute: for I in Some_Array'Range loop Process (Some_Array (I)); end loop; where I _can't_ exceeed the bounds, so it would be surprising if a compiler inserted bounds checks. Is there a Fortran equivalent? I seem to remember something like that in VAX F77, but it's been a while...