eliminating array bounds checking overhead

mayur_naik@my-deja.com
26 Apr 2000 02:44:19 -0400

          From comp.compilers

Related articles
eliminating array bounds checking overhead mayur_naik@my-deja.com (2000-04-26)
Re: eliminating array bounds checking overhead stephan@pcrm.win.tue.nl (2000-04-27)
Re: eliminating array bounds checking overhead vugluskr@unicorn.math.spbu.ru (2000-04-27)
Re: eliminating array bounds checking overhead jprice@scdt.intel.com (2000-04-27)
Re: eliminating array bounds checking overhead blaak@infomatch.com (Ray Blaak) (2000-04-27)
Re: eliminating array bounds checking overhead Sid-Ahmed-Ali.TOUATI@inria.fr (Sid Ahmed Ali TOUATI) (2000-04-27)
Re: eliminating array bounds checking overhead rhyde@shoe-size.com (Randall Hyde) (2000-04-27)
[16 later articles]
| List of all articles for this month |

From: mayur_naik@my-deja.com
Newsgroups: comp.compilers
Date: 26 Apr 2000 02:44:19 -0400
Organization: Deja.com - Before you buy.
Keywords: optimize, question

Hello


I wish to perform an array lookup of the form:


if (i > lo && i < hi)
          printf("%d", A[i]);
else
          printf("index out of bounds");


The above code is executed several times. The probability that 'i' is
between 'lo' and 'hi' is VERY high and I want to eliminate the
overhead of the 2 less-than tests. Does any language or any machine
provide some mechanism to:


1. index an array without checking its bounds
2. throw an exception if the index was actually out of range
3. allow the programmer to catch and handle the exception rather than
      terminate the program


Thanks in advance.


-- Mayur


Post a followup to this message

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