comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@world.std.com>
Subject: Re: Compilers for VAX Was: Ada version of C's 'static'
Date: 1999/08/10
Date: 1999-08-10T00:00:00+00:00	[thread overview]
Message-ID: <wccaerzhlh3.fsf@world.std.com> (raw)
In-Reply-To: 7on41u$3rf@dfw-ixnews19.ix.netcom.com

Richard D Riehle <laoXhai@ix.netcom.com> writes:

> Not easy.  Not necessarily safe.  I just discovered that another
> favorite language that emits intermediate C code fails to detect
> the famous C "integer overflow" problem at run-time.

The AdaMagic compiler correctly handles integer overflow.

For efficiency, we need to tailor this part of the compiler to the
specific target.  We also have a completely portable (but less
efficient) mechanism.  And we also have a high-level optimizer that's
pretty good at removing overflow checks entirely (which is of course
most efficient).

This is part of what I meant by "non-zero work".  But it's still
substantially faster to port this compiler than to a new C compiler than
to write a completely new code generator.  (Our front end also has
targets supported in that more traditional way.)

>...  Even though
> C is sometimes thought of as a "universal assembler" suitable for
> "C Pass" compilers, ...

It's kind of annoying to hear C called a "universal assembler" when it
can't deal with integer overflow nearly as well as any real assembly
language I've used.

>... one needs to ensure that the rigorous demands
> of Ada are still satisfied.  I guess conformance (ACVC) tests are 
> still useful.

Indeed.  There's no way we could get away without properly implementing
overflow -- there are dozens of ACVC tests that would fail.  Er, I mean,
ACATS tests.

Another "interesting" issue is stack overflow detection.  The SHARC chip
has a zero-overhead mechanism built into the hardware, but of course
standard C doesn't give us any direct access to that -- we had to write
a little bit of assembly code.

- Bob
-- 
Change robert to bob to get my real email address.  Sorry.




  parent reply	other threads:[~1999-08-10  0:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-19  0:00 Ada version of C's 'static' Craig Allen
1999-07-19  0:00 ` David Botton
1999-07-20  0:00 ` Simon Wright
1999-07-23  0:00 ` Tucker Taft
1999-07-30  0:00   ` Craig Allen
1999-08-03  0:00     ` Compilers for VAX Was: " Erdelyi Gaspar
1999-08-03  0:00       ` Larry Kilgallen
1999-08-04  0:00       ` Robert Dewar
1999-08-04  0:00         ` Rod Chapman
1999-08-04  0:00           ` Robert Dewar
1999-08-04  0:00           ` Larry Kilgallen
1999-08-04  0:00             ` Robert Dewar
1999-08-04  0:00             ` Marin David Condic
1999-08-04  0:00               ` Robert Dewar
1999-08-04  0:00               ` Larry Kilgallen
1999-08-04  0:00         ` Chris Miller
1999-08-05  0:00           ` Robert Dewar
1999-08-04  0:00       ` Steve Doiel
1999-08-05  0:00         ` Robert Dewar
1999-08-05  0:00           ` Larry Kilgallen
1999-08-06  0:00             ` Robert A Duff
1999-08-06  0:00               ` Larry Kilgallen
1999-08-09  0:00                 ` Robert A Duff
1999-08-09  0:00                   ` Richard D Riehle
1999-08-09  0:00                     ` Tucker Taft
1999-08-10  0:00                     ` Robert A Duff [this message]
1999-08-08  0:00               ` Robert Dewar
replies disabled

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