comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Concerning subscript bounds checks
Date: 1996/06/24
Date: 1996-06-24T00:00:00+00:00	[thread overview]
Message-ID: <dewar.835605866@schonberg> (raw)
In-Reply-To: 4ql9eq$hdt@goanna.cs.rmit.EDU.AU

Richard said

"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.)"

Yes, indeed for this kind of Fortran algorithm, almost all checks can
be eliminated (even if we don't get the last 4, we are certainly doing
well).

For reasonably thorough global analysis tecniques used to optimize checks
(e.g. the old Alsys technology using partial redundancy techniques), it
is reasonable to estimate that the total cost of checks is of the order
of 10%.

Even more interesting than the range checks is the issue of getting rid
of elaboration checks, and of course getting rid of overflow checks is
quite hard (you really need the full machinery of range analysis for
this, and even then you don't get very far). However in the Fortran
world, you are dealing with floating-point, and floating-point overflow
is often close to free to detect at the hardware level (e.g. by 
implementing IEEE infinities -- neither IEEE nor Ada requires exception
traps at runtime for floating-point).

So I certainly do not want to argue with Richard's "central point". It is
an important one that needs repeating, I was just commenting around the
edge on those remaining four checks. Richard have you actually implemented
a compiler that eliinates these checks? That would be interesting if so,
and it would be interesting to have the reference.





  reply	other threads:[~1996-06-24  0:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-21  0:00 Concerning subscript bounds checks Richard A. O'Keefe
1996-06-21  0:00 ` Robert Dewar
1996-06-24  0:00   ` Richard A. O'Keefe
1996-06-24  0:00     ` Robert Dewar [this message]
1996-06-28  0:00     ` joeuser
1996-06-28  0:00       ` Adam Beneschan
1996-07-01  0:00       ` Richard A. O'Keefe
1996-07-01  0:00         ` Robert A Duff
1996-07-02  0:00           ` Richard A. O'Keefe
1996-06-24  0:00   ` William Clodius
1996-06-27  0:00     ` Richard A. O'Keefe
1996-06-28  0:00       ` Ken Thomas
1996-06-24  0:00   ` Adam Beneschan
1996-06-25  0:00 ` ++           robin
1996-06-27  0:00   ` Richard A. O'Keefe
1996-06-25  0:00 ` William Clodius
replies disabled

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