From: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe)
Subject: Re: Ada to C/C++ translator needed
Date: 1996/10/01
Date: 1996-10-01T00:00:00+00:00 [thread overview]
Message-ID: <52q47q$m8j@goanna.cs.rmit.edu.au> (raw)
In-Reply-To: 01bbae8f$dffbd440$32ee6fcf@timhome2
"Tim Behrendsen" <tim@airshields.com> writes:
>I know that Ada does run-time checks of array bounds that C
>doesn't do; that could be one source of loss of performance.
>Does Ada do any other run-time checks that C doesn't do?
It is seriously misleading to say that Ada "does" run-time checks
that C doesn't. To start with, there are (very useful) C implementations
that do bounds checks at run time, and the C standard was carefully
crafted to allow this (one possible area of conflict was the struct hack,
but it has been rules that the struct hack is not legal C any more).
The second point is that bounds checks can very often be eliminated
by the optimiser. This is an *old* result (the first mention I saw of
it was in one of the SETL papers back in the early 70s). It should be
obvious that
for I in A'Range loop ... use A(I) ... end loop;
isn't going to need any range checks, even when the bounds of A are
dynamic. A lot of Ada array references are of this form. A recent
paper which I think was talking about Fortran (the relevant proceedings
are not in this office right now) claimed 95% elimination. And to finish,
pragma Suppress can be used to request supression of many checks,
including bounds checks. It's win-win: you get the *choice*.
--
Australian citizen since 14 August 1996. *Now* I can vote the xxxs out!
Richard A. O'Keefe; http://www.cs.rmit.edu.au/%7Eok; RMIT Comp.Sci.
next prev parent reply other threads:[~1996-10-01 0:00 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-09-25 0:00 Ada to C/C++ translator needed Emmanuel Champommier
1996-09-25 0:00 ` David Weller
1996-10-02 0:00 ` B|rje Norden
1996-10-04 0:00 ` David Weller
1996-10-05 0:00 ` Robert Dewar
1996-10-05 0:00 ` Frank Manning
1996-10-06 0:00 ` Samuel Tardieu
1996-10-07 0:00 ` Richard Kenner
1996-10-07 0:00 ` Robert Dewar
1996-10-08 0:00 ` Stephen Leake
1996-10-07 0:00 ` Robert Dewar
1996-10-08 0:00 ` Frank Manning
1996-10-07 0:00 ` Erik Magnuson
1996-09-26 0:00 ` Ian Ward
1996-10-02 0:00 ` Jon S Anthony
1996-10-02 0:00 ` Jon S Anthony
[not found] ` <52feul$os2@goanna.cs.rmit.edu.au>
1996-09-28 0:00 ` Tim Behrendsen
1996-09-29 0:00 ` Ken Pizzini
1996-09-29 0:00 ` Tim Behrendsen
1996-09-29 0:00 ` Robert Dewar
1996-09-30 0:00 ` Tim Behrendsen
1996-09-30 0:00 ` Matthew Heaney
1996-09-30 0:00 ` Tim Behrendsen
1996-09-30 0:00 ` William Clodius
1996-10-01 0:00 ` Richard A. O'Keefe [this message]
1996-09-30 0:00 ` Richard A. O'Keefe
1996-09-30 0:00 ` Tim Behrendsen
1996-09-30 0:00 ` Richard A. O'Keefe
1996-09-30 0:00 ` Tim Behrendsen
1996-09-30 0:00 ` Peter Seebach
1996-09-30 0:00 ` Tim Behrendsen
1996-10-01 0:00 ` Richard A. O'Keefe
1996-10-01 0:00 ` Tim Behrendsen
1996-10-02 0:00 ` Ian Ward
1996-10-02 0:00 ` Tim Behrendsen
1996-09-30 0:00 ` Peter Seebach
1996-10-02 0:00 ` Richard A. O'Keefe
1996-10-05 0:00 ` Lawrence Kirby
1996-10-06 0:00 ` Tanmoy Bhattacharya
1996-10-06 0:00 ` Lawrence Kirby
1996-10-08 0:00 ` Peter Seebach
1996-10-07 0:00 ` Tanmoy Bhattacharya
-- strict thread matches above, loose matches on Subject: below --
1996-10-02 0:00 Simon Johnston
1996-10-07 0:00 ` Richard Riehle
1996-10-09 0:00 ` Richard A. O'Keefe
1996-10-15 0:00 ` Tucker Taft
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox