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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f891f,eac70c5fad02d925 X-Google-Attributes: gidf891f,public X-Google-Thread: 103376,eac70c5fad02d925 X-Google-Attributes: gid103376,public From: clodius@hotspec.lanl.gov (William Clodius) Subject: Re: Concerning subscript bounds checks Date: 1996/06/24 Message-ID: #1/1 X-Deja-AN: 161863563 sender: clodius@hotspec.lanl.gov references: <4qdj3e$btf@goanna.cs.rmit.EDU.AU> followup-to: comp.lang.ada,comp.lang.misc,comp.lang.fortran organization: Los Alamos National Laboratory newsgroups: comp.lang.ada,comp.lang.misc Date: 1996-06-24T00:00:00+00:00 List-Id: In article <4ql9eq$hdt@goanna.cs.rmit.EDU.AU> ok@goanna.cs.rmit.EDU.AU (Richard A. O'Keefe) writes: From: ok@goanna.cs.rmit.EDU.AU (Richard A. O'Keefe) Keywords: subscripts Newsgroups: comp.lang.ada,comp.lang.misc Date: 24 Jun 1996 15:35:22 +1000 Organization: Comp Sci, RMIT, Melbourne, Australia Path: newshost.lanl.gov!ncar!gatech!swrinde!ihnp4.ucsd.edu!munnari.OZ.AU!news.mel.connect.com.au!news.mira.net.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!goanna.cs.rmit.EDU.AU!not-for-mail Lines: 60 References: <4qdj3e$btf@goanna.cs.rmit.EDU.AU> NNTP-Posting-Host: goanna.cs.rmit.edu.au NNTP-Posting-User: ok X-Newsreader: NN version 6.5.0 #0 (NOV) Xref: newshost.lanl.gov comp.lang.ada:13943 comp.lang.misc:25665 The central point I was making was a very simple, very obvious, very positive one: I translated an algorithm from Fortran to Ada, and it _easily_ and _naturally_ fell out that 62 out of 66 subscripts could _obviously_ be compiled without checks using purely local information (no data flow or range analysis needed). I call that a _good_ result. (The 4 subscripts that aren't quite so obvious are executed with low frequency, and only the upper bound is not obviously safe.) But the comparison is not complete as it is done only one way. I remember reading somewhere that in the 80s an experimental F77 compiler was written that could optimize away 90% of all array bounds checks on a large variety of codes when array bounds checking was turned on. (I don't know if this capability was ever implemented in a commercial Fortran compiler, but then it hasn't been implemented in the obvious Ada 95 compiler.) Did you check to see what an equivalent algorithm would do on the original F77 code? How would it do if rewritten in F90 stle? -- William B. Clodius Phone: (505)-665-9370 Los Alamos National Laboratory Email: wclodius@lanl.gov Los Alamos, NM 87545