comp.lang.ada
 help / color / mirror / Atom feed
From: dennison@telepath.com
Subject: Re: How does GNAT (or GCC) compile ADA code?
Date: 1998/10/22
Date: 1998-10-22T00:00:00+00:00	[thread overview]
Message-ID: <70nqr2$90b$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 70lttj$mrp@netline.jpl.nasa.gov

In article <70lttj$mrp@netline.jpl.nasa.gov>,
  vsnyder@vanpcjpl.nasa.gov (Van Snyder) wrote:
> In article <707h7o$cvl$1@nnrp1.dejanews.com>, dennison@telepath.com writes:
> > So here's what gnat does. It converts (translates, compiles, whatever term
> > you prefer) Ada source code into the special intermediate form that the gcc
> > backend understands. Then it has the gcc backend do optimizations and
machine
> > code generation.
>
> Does the gcc backend understand that C and C++ pointers can point _anywhere_,
> while Ada and Fortran 90 pointers are quite disciplined?  The important
> consequence of this observation is that optimization becomes possible.  The
> inability to optimize pointers is the primary reason that C and C++ programs
> are generally slower than equivalent Fortran 90 programs.  To my knowledge,
> there are no Fortran 90 compilers that use the gcc backend.

I'm sure there are folks here much better aquainted with what the gcc backend
is capable of than myself. But as far as I understand it, the answer is *no*.
That is why if you hang out here long enough you are bound to here Robert
Dewar mention that a gcc compiled C executable should have little significant
difference from a gnat compiled Ada executable if the two perform the same
operations. If you know what you are doing, you can even make them produce
the exact same executables.

In theory that does mean gnat is missing out on a lot of extra optimization
it could be doing. In practice gcc already has very good (and certianly the
most thouroughly tested) optimization because of all the work that is done on
it for C code. Just getting a custom back-end up to gcc's level would be a
great deal of work.


--
T.E.D.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




      reply	other threads:[~1998-10-22  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-15  0:00 How does GNAT (or GCC) compile ADA code? Arun Mangalam
1998-10-16  0:00 ` dennison
1998-10-16  0:00   ` dewarr
1998-10-22  0:00   ` Van Snyder
1998-10-22  0:00     ` dennison [this message]
replies disabled

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