array index checking optimizations?

Dave Lloyd <dave@occl-cam.demon.co.uk>
2 May 1996 23:29:06 -0400

          From comp.compilers

Related articles
array index checking optimizations? adams@yaroslav.ai.mit.edu (1996-04-29)
Re: array index checking optimizations? bill@amber.ssd.hcsc.com (1996-04-30)
Re: array index checking optimizations? kik@zia.cray.com (1996-04-30)
Re: array index checking optimizations? tmb@best.com (1996-05-01)
Re: array index checking optimizations? Laurent.Guerby@enst-bretagne.fr (Laurent Guerby) (1996-05-01)
Re: array index checking optimizations? markt@harlequin.co.uk (1996-05-01)
array index checking optimizations? dave@occl-cam.demon.co.uk (Dave Lloyd) (1996-05-02)
Re: array index checking optimizations? mad@math.keio.ac.jp (1996-05-03)
Re: array index checking optimizations? prener@watson.ibm.com (1996-05-03)
Re: array index checking optimizations? ben@sys.toronto.edu (1996-05-03)
Re: array index checking optimizations? dlmoore@ix.netcom.com (1996-05-03)
Re: array index checking optimizations? tmb@best.com (1996-05-05)
Re: array index checking optimizations? Patrick.Cousot@ens.fr (Patrick Cousot) (1996-05-08)
| List of all articles for this month |

From: Dave Lloyd <dave@occl-cam.demon.co.uk>
Newsgroups: comp.compilers
Date: 2 May 1996 23:29:06 -0400
Organization: Compilers Central
References: 96-04-140
Keywords: optimize

> I am curious if there are any compilers out there that can detect that
> all the array references in the following program are safe, and thus
> no array indexes need to be checked.


Our Algol 68 and NAS's Fortran 90 compilers do this in most common
circumstances. We track the bounds of an array as part of its
descriptor (including old-fashion F77-style arrays) and track the
range of integer values in an algebraic form that allows us to
maintain the interval after subsequent arithmetic operations. The
ranges are initially derived from the bounds of loops. The compiler
then naturally eliminates bound-checks where the range of the integer
index is always within the bounds. Our logic does not track subranges
so well though, so some index expressions are still checked that need
not be.


The principal problem with your example for us, is that our current
algebra is not sufficiently agressive to determine bounds for "i". Our
next round of optimisations should sort it out though.


----------------------------------------------------------------------
Dave Lloyd Email: Dave@occl-cam.demon.co.uk
Oxford and Cambridge Compilers Ltd Phone: (44) 1223 572074
55 Brampton Rd, Cambridge CB1 3HJ, UK
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.