comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Does ObjectAda optimize at all??
Date: 1998/08/07
Date: 1998-08-07T00:00:00+00:00	[thread overview]
Message-ID: <dewar.902544846@merv> (raw)
In-Reply-To: 6qem47$j12@news.kvaerner.com

T.E.D. said

<<>I can't find anything about it in their printed documentation. Their online
>help has three references; two for turning off checks and one reference to
>annex M where they state that they ignore "pragma optimize".
>>


Note that most compilers ignore pragma Optimize. This "feature" of Ada 83
represented a naive and not very helpful view of what optimization is all
about (*). Remember that the issue is not what optimizations a compiler
performs but what the quality of the generated code is. This is particularly
important for an Ada compiler, where the classical optimizations that you
read about say in the Dragon book are only a small part of the total issues
involved in generating efficient code.

That being said it is of course interesting to ask what optimization 
flexibility is provided, and most certainly a compiler with no control
over optimization levels is going to be unsuitable for some kinds of
applications (e.g. safety critical applications often want a minimum
of optimization to improve tracability of code for certification
purposes, whereas obviously other applications want the fastest
code possible and are most certainly willing to sacrifice 
object to source tracability.

Note incidentally that GNAT in addition to the -O0/1/2/3 levels that specify
general optimization control (and the related -gnatn and -gnatN switches)
also recognizes all the (rather large set of) specific optimization control
switches provided by gcc (e.g. -funroll-loops and -funroll-all-loops). I
would guess that most of these switches get VERY little use, but who knows?

(*) What GNAT does with pragma Optimize is warn you if you use this pragma
and then compile without optimization, but it is much too late for the
pragma to actually affect optimization, since the GCC driver needs to know
optimization levels and requirements *before* it starts compiling the code.

Robert Dewar
Ada Core Technologies





  reply	other threads:[~1998-08-07  0:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-06  0:00 Does ObjectAda optimize at all?? dennison
1998-08-06  0:00 ` Jerry van Dijk
1998-08-07  0:00   ` dennison
1998-08-07  0:00 ` Tarjei Tj�stheim Jensen
1998-08-07  0:00   ` Robert Dewar [this message]
1998-08-09  0:00 ` Dave Wood
1998-08-10  0:00   ` dennison
1998-08-14  0:00     ` Tom Moran
1998-08-14  0:00       ` dennison
1998-08-15  0:00         ` Larry Kilgallen
1998-08-17  0:00           ` dennison
1998-08-15  0:00         ` Tom Moran
1998-08-14  0:00           ` Steve Doiel
1998-08-16  0:00         ` Tom Moran
1998-08-16  0:00         ` Robert Dewar
1998-08-17  0:00           ` dennison
  -- strict thread matches above, loose matches on Subject: below --
1998-08-22  0:00 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