comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <dewar@gnat.com>
Subject: Re: Apex vs GNAT on solaris
Date: 1999/12/08
Date: 1999-12-08T00:00:00+00:00	[thread overview]
Message-ID: <82ku6s$jhi$1@nnrp1.deja.com> (raw)
In-Reply-To: 384cfdb3.691883075@newsnew.draper.com

In article <384cfdb3.691883075@newsnew.draper.com>,
  rracine@myremarq.com (Roger Racine) wrote:
> Is it a mistake to use the default options for a compiler?

Yes, it is a mistake if the default options do not correspond
to your needs, there are many options available.

> Many people will assume that the default options are the most
> reliable options.

They will assume wrong. For example, in the case of GNAT,
we let -O0 be the default because that is traditional in
all gcc compilers. We make inlining off the default, because
that seems more compatible with -O0 as the default.

> Others will assume that the default options are the best
> options.

They will assume wrong, there is no "best options", there is
only the appropriate options for your particular use.

> The default options generally turn out to be the most
> reliable because most people use them

Not true in the GCC/GNAT world, virtually all users plan on
setting at least -O1 for actual production work (-O0 is almost
never suitable for production work, it is usually only used
while debugging, since it is easier to debug unoptimized code).

> and bugs will be discovered and corrected sooner than those to
> be found using the non-default options.

Well you may guess this, but it is wrong for gcc. Far more code
is run with optimization on. It is not common to find bugs that
depend on the optimization level in the gcc technology (since
the backend is mature), but when they do arise, they are just
as likely to be bugs that show up ONLY with optimization off.

> The same can be said for tasking.

Again, this can be misleading. For example, on Solaris, the
system thread support is definitely buggy, and indeed we have
found it impossible to provide full Annex D support on Solaris,
even in realtime mode (it is out of the question in non-real
time, i.e. non-root mode). The FSU threads is FAR more reliable.
The choice of defaults is not based on reliability or accuracy
[which would dictate FSU], but usability, most people want to
use system threads [I assume this is what you mean by Posix
threads, your designation is confusing, since of course FSU
is also Posix compliant].

> I have been hit many times by optimizer bugs

Yes, that is true of many compilers, especially those with Ada
specific home spun code generators, but even there I think this
is mostly a historic factor, perhaps users of non-GNAT
technologies can comment ... Certainly there are some old
Ada 83 compilers that show this phenomenon. We have several
customers who report they cannot use their old Ada 83 compilers
with optimization on for this reason. But to repeat, gcc is
almost always used with optimization on, except when doing
initial debugging, so this kind of reliability problem is
not an issue. Once again, I am not saying that there is no
such thing as an optimization bug in the gcc technology, we
have occasionally run into such bugs and fixed them. The point
is that turning optimization ON is just as likely to remove bugs
as to cause them (and both are low probability events).

> and generally assum  that the compiler vendors knows what they
> are doing when the defaults are created.

We know EXACTLY what we are doing when we create the defaults,
it just does not happen to correspond to any of your guesses.

> They are giving what they think should be the most
> common values for the options.

Nope, that's plain wrong in the case of gcc! The important thing
in our mind is to be consistent with other uses of gcc, so that
the usage will be the same for GNAT, gnu C, g++ etc.

Robert Dewar
Ada Core Technologies


Sent via Deja.com http://www.deja.com/
Before you buy.




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

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-07  0:00 Apex vs GNAT on solaris reason67
1999-12-07  0:00 ` reason67
1999-12-07  0:00 ` Robert Dewar
1999-12-07  0:00   ` reason67
1999-12-08  0:00     ` Robert Dewar
1999-12-08  0:00       ` reason67
1999-12-08  0:00         ` Robert Dewar
1999-12-08  0:00         ` Larry Kilgallen
1999-12-08  0:00         ` Robert A Duff
1999-12-07  0:00   ` Roger Racine
1999-12-07  0:00     ` Larry Kilgallen
1999-12-07  0:00     ` Samuel T. Harris
1999-12-07  0:00     ` Jean-Pierre Rosen
1999-12-07  0:00     ` David Starner
1999-12-08  0:00       ` Robert Dewar
1999-12-08  0:00     ` Robert Dewar [this message]
1999-12-08  0:00       ` Robert A Duff
1999-12-08  0:00       ` Roger Racine
1999-12-08  0:00         ` Larry Kilgallen
1999-12-08  0:00           ` Roger Racine
1999-12-08  0:00             ` tmoran
1999-12-08  0:00             ` Larry Kilgallen
1999-12-09  0:00         ` Robert Dewar
1999-12-09  0:00           ` Roger Racine
1999-12-09  0:00             ` Larry Kilgallen
1999-12-10  0:00               ` Robert Dewar
1999-12-09  0:00             ` Mike Silva
1999-12-10  0:00               ` Robert Dewar
1999-12-16  0:00             ` Stefan Skoglund
1999-12-08  0:00     ` Ted Dennison
1999-12-07  0:00 ` reason67
1999-12-07  0:00 ` reason67
1999-12-07  0:00 ` reason67
1999-12-07  0:00 ` reason67
1999-12-07  0:00   ` Robert Dewar
1999-12-07  0:00     ` reason67
1999-12-08  0:00       ` Robert Dewar
1999-12-08  0:00         ` reason67
1999-12-07  0:00     ` Vladimir Olensky
1999-12-07  0:00       ` Vladimir Olensky
1999-12-09  0:00       ` Geoff Bull
1999-12-09  0:00         ` Vladimir Olensky
1999-12-10  0:00           ` Vladimir Olensky
1999-12-09  0:00         ` Vladimir Olensky
1999-12-07  0:00 ` reason67
1999-12-07  0:00 ` reason67
1999-12-07  0:00   ` Robert Dewar
1999-12-07  0:00     ` reason67
replies disabled

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