Re: eliminating array bounds checking overhead

Robert A Duff <world!bobduff@uunet.uu.net>
4 May 2000 17:16:36 -0400

          From comp.compilers

Related articles
[13 earlier articles]
Re: eliminating array bounds checking overhead d95josef@dtek.chalmers.se (2000-04-30)
Re: eliminating array bounds checking overhead mayur_naik@my-deja.com (2000-04-30)
Re: eliminating array bounds checking overhead terryg@uswest.net (Terry Greyzck) (2000-05-01)
Re: eliminating array bounds checking overhead monnier+comp/compilers/news/@flint.cs.yale.edu (Stefan Monnier) (2000-05-01)
Re: eliminating array bounds checking overhead r_c_chapman@my-deja.com (2000-05-01)
Re: eliminating array bounds checking overhead markw65@my-deja.com (Mark Williams) (2000-05-04)
Re: eliminating array bounds checking overhead world!bobduff@uunet.uu.net (Robert A Duff) (2000-05-04)
Re: eliminating array bounds checking overhead paule@martex.gen.oh.us (Paul Evans) (2000-05-04)
Re: eliminating array bounds checking overhead d95josef@dtek.chalmers.se (Josef Sveningsson) (2000-05-12)
Re: eliminating array bounds checking overhead mtimmerm@opentext.nospam-remove.com (Matt Timmermans) (2000-05-12)
| List of all articles for this month |
From: Robert A Duff <world!bobduff@uunet.uu.net>
Newsgroups: comp.compilers
Date: 4 May 2000 17:16:36 -0400
Organization: The World Public Access UNIX, Brookline, MA
References: 00-04-194 00-04-211 00-04-222 00-05-010
Keywords: optimize, design

"Stefan Monnier" <monnier+comp/compilers/news/@flint.cs.yale.edu> writes:


> Very very very few languages allow arrays where the high bound is
> lower then the low bound. So the only "interesting case is when
> lo==hi, but that is also rare enough to be either disallowed or
> handled specially.


In my opinion, any language that disallows empty arrays or one-element
arrays is broken. Yes, I know some popular languages are broken. ;-)
But many are not.


For example, in Ada:


        X: constant String := "";


X is an array of Character whose bounds are 1..0; ie the upper bound is
less than the lower bound. (There's no nul character in there!)


- Bob


Post a followup to this message

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