what is difference between gcc-ada and GNAT????

Robert Dewar dewar@adacore.com
Fri Feb 16 12:49:00 GMT 2007

Duncan Sands wrote:

> GNAT Pro is ACT's commercial offering: you have to have a support contract
> with them to get it.  GNAT GPL is basically the same compiler

No, that's not quite true, the versions of GNAT GPL do not correspond
precisely to those of GNAT Pro, partly because the academic year release
cycle is different from our commercial release cycle. Also the GPL
version is Ada 2005 by default, while GNAT Pro is still Ada 95 by
default (switches can be used in either case to change the default,
but this difference indicates rather different intended use, where
we expect university folks -- the GPL version supports our GAP
program -- to be using latest stuff, where we expect the commercial
users to be more interested in absolute stability.)

> but it is
> unsupported

not entirely true, it is fully supported for schools and universities
under our GAP (GNAT Academic Program), which provides full support at
no cost to schools and universities

, and the license has been changed so that software built with
> and distributed to the world has to be under the GPL license to be legal
> (at least, that seems to be the intention).

That is indeed the situation (and intention). This is consistent with
the basic academic orientation of the GPL version, where we want to
encourage the production of free software.

> The technical differences between the compilers are basically in the code
> generators: the ACT compilers use a modified code generator from gcc 3.4.6.

Actually almost all current ports use a modified version of gcc 4.1, so 
this is obsolete information. However, the modified is important here.
For the AdaCore versions we take a stable cut of the gcc code generator
and then patch it to eliminate any problems with its use by GNAT. These
patches are always submitted to the FSF, but of course so are many other
patches, some of which inevitably break GNAT (see below on testing). It
is our constant aim to minimize the size of the patch file, but it is
certainly not null (the patch file for version 4.1 gcc used in our
current development builds is nearly 800K bytes long).

> However the ACT compilers tend to be more stable than the FSF ones, because
> the FSF code generators and the Ada front-end do not yet interact perfectly.

It's not a matter of perfect interaction, it is more a matter of
testing and stabilization. The GCC environment hosts a lot of
interesting development efforts to improve the compiler on a long
term basis, and that inevitably results in some lack of stability
at the development front. Certainly things improve as time goes on.

> I understand that the next releases of GNAT GPL and GNAT Pro will be based
> on the same code generator as the FSF compilers, at which point the difference
> between the FSF and ACT offerings will doubtless be much less.

All AdaCore development on the GNAT front end, and the related back end
patches are submitted to the FSF, but there is always a moving target
problem, there is a lag in submitting these patches, simply because
we don't have the resources to do it any faster, and there are always
new patches being incorporated into gcc, which may impact Ada. Right
now for instance, the GNAT build is broken. Eric is hoping to submit
the patches to fix this within a day or two, but meanwhile we have
more than a slight instability here!

With regard to testing, a very important difference is the level of
testing. AdaCore has proprietary test suites containing tens of
millions of lines of Ada code used to test the commercial version.
The results of this testing result in fixes and improvements that
are later reflected in the fsf version, but the fsf version itself
is not run against this test suite (we could imagine running it
every day, but we would not have the resources to analyze or deal
with the results of such testing, and since the tests are proprietary
no one else could deal with this -- the tests are proprietary since
they come from customer code, we also use the proprietary DEC test

However, this does not mean the testing situation for the FSF
version of GNAT is hopeless. That's not at all the case. We have
two sources of useful tests:

1. the ACATS tests, currently being successfully used with
the FSF version.

2. Tests that come with patches. For some time now, AdaCore has
been following a procedure of including a simple reduced test
case for all patches to GNAT that are submitted to the FSF.
These tests are pretty extensive at this stage, and are preserved
in the patch submission files. However, no one has assembled them
into a harness that can be practically used. This would be a
really useful contribution to improved stability of the FSF
version of GNAT. AdaCore does not have the resources to do
this, but it is a project that someone else could certainly
take on.

Robert Dewar

More information about the Gcc mailing list