comp.lang.ada
 help / color / mirror / Atom feed
From: Vinzent Hoefler <ada.rocks@jlfencey.com>
Subject: Re: Optimizing Boundary Checks
Date: Fri, 13 Jun 2003 15:48:32 +0200
Date: 2003-06-13T15:48:32+02:00	[thread overview]
Message-ID: <bcckq8$i67ah$1@ID-175126.news.dfncis.de> (raw)
In-Reply-To: bccjsp$lid$1@hercules.btinternet.com

Martin Dowie wrote:

>Keyword in the last line is 'can'. I've run across compilers that
>will do no optimization (i.e. leave checks in) on code such as:
>
>   for I in My_Type loop
>      Make_Call(My_Array (I));
>   end loop;
>
>but would take them out if written:
>
>   for I in My_Array'Range loop
>      Make_Call(My_Array(I));
>   end loop;

This I find interesting. (Of course, assuming that My_Type is the
Index type of My_Array).

>Not sure if the checks in the first example would have
>disappeared if we'd been allowed to switch compiler
>optimizations on...

I'd guess so.

>I guess the you just have to get that assembler listing and
>check what each compiler you use does!

Yes. I'd say, the only thing we know is where the compiler is required
to do range checks, not where it is permitted to suppress them.


Vinzent.



  reply	other threads:[~2003-06-13 13:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-13 11:49 Optimizing Boundary Checks Preben Randhol
2003-06-13 12:03 ` Erlo Haugen
2003-06-13 12:38   ` Vinzent Hoefler
2003-06-13 12:47     ` Preben Randhol
2003-06-13 13:28       ` Vinzent Hoefler
2003-06-13 12:42   ` Preben Randhol
2003-06-13 12:48     ` Preben Randhol
2003-06-13 13:28       ` Vinzent Hoefler
2003-06-13 13:56         ` Preben Randhol
2003-06-13 14:42           ` Vinzent Hoefler
2003-06-13 15:25             ` Preben Randhol
2003-06-13 15:34               ` Vinzent Hoefler
2003-06-14 10:45                 ` Preben Randhol
2003-06-14 14:59                   ` James Rogers
2003-06-13 13:33       ` Peter Amey
2003-06-13 13:34 ` Martin Dowie
2003-06-13 13:48   ` Vinzent Hoefler [this message]
2003-06-13 14:37     ` Martin Dowie
2003-06-13 15:12       ` Vinzent Hoefler
2003-06-14  2:01         ` Jeffrey Carter
2003-06-16 11:23           ` Vinzent Hoefler
2003-06-14  8:34         ` Dmitry A. Kazakov
2003-06-14 17:20         ` Robert I. Eachus
2003-06-16 11:23           ` Vinzent Hoefler
2003-06-18 20:58             ` Brian Gaffney
2003-06-13 13:45 ` Dale Stanbrough
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox