comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: ada -> C translator
Date: 1997/04/03
Date: 1997-04-03T00:00:00+00:00	[thread overview]
Message-ID: <dewar.860116304@merv> (raw)
In-Reply-To: dewar.860115718@merv


Just to give a bit more detail on the overflow issue, and a specific example.
Consider the PPC architecture with its sticky bit.

The proper efficient code is to compute a whole expression, or at least a cjunk
of it with no calls, and then do one test of the sticky bit. There is no
way I know of to persaude a C compiler to get anywhere near to optimal code.

Note: the reason that I know this particular technical problem very well
is that in its current form, gcc does not know how to generate efficient
overflow checks. So even though we are not generating C in GNAT, we suffer
from similar limitations. Yes, we can play some tricks, like ICC did, but
we can't get really efficient overflow checking, not till gcc is properly
taught to handle overflow (note that the reason that gcc does not know
how to generate efficient overflow checking is because C does not know
about overflows!)

Given that gcc started life as a C code generator, one of the dynamics
of the GNAT project is that we have faced many of the same problems that
one would face generating C, though not all -- critically GNU C has
nested procedures, which standard C does not!

A critical difference is that, unlike the situation where you are stuck
generating C, we can over time teach gcc to know more about Ada specific
requirements. We have taught it quite a bit -- it still needs to be taught
more, notably in the areas of overflow checking and exception handling.





  reply	other threads:[~1997-04-03  0:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-03  0:00 ada -> C translator Gabriel Monaton
1997-04-03  0:00 ` Robert A Duff
1997-04-03  0:00   ` Robert Dewar
1997-04-03  0:00     ` Robert Dewar [this message]
1997-04-04  0:00     ` Fergus Henderson
1997-04-04  0:00       ` Richard Kenner
1997-04-05  0:00         ` Fergus Henderson
1997-04-04  0:00       ` Robert Dewar
1997-04-05  0:00         ` Fergus Henderson
1997-04-06  0:00           ` Robert Dewar
1997-04-07  0:00             ` Fergus Henderson
1997-04-07  0:00               ` Robert Dewar
1997-04-08  0:00                 ` Fergus Henderson
1997-04-08  0:00                   ` Robert Dewar
1997-04-08  0:00                     ` William Clodius
1997-04-09  0:00                     ` Fergus Henderson
1997-04-09  0:00                       ` Robert Dewar
1997-04-09  0:00                         ` Fergus Henderson
1997-04-09  0:00                           ` Robert Dewar
1997-04-10  0:00                             ` Fergus Henderson
1997-04-09  0:00                       ` William Clodius
1997-04-08  0:00                 ` Richard A. O'Keefe
1997-04-08  0:00                   ` Robert Dewar
1997-04-08  0:00                   ` William Clodius
1997-04-09  0:00                     ` Fergus Henderson
1997-04-04  0:00     ` Larry Kilgallen
1997-04-04  0:00       ` Robert Dewar
1997-04-05  0:00         ` Larry Kilgallen
1997-04-06  0:00           ` Robert Dewar
     [not found] ` <lvlo6iwws8.fsf@sulu.fl.ensco.com>
1997-04-17  0:00   ` Lance Kibblewhite
replies disabled

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