From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,168a42f49aadcfd8 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Does ObjectAda optimize at all?? Date: 1998/08/07 Message-ID: #1/1 X-Deja-AN: 379050994 References: <6qcl1i$qij$1@nnrp1.dejanews.com> <6qem47$j12@news.kvaerner.com> X-Complaints-To: usenet@news.nyu.edu X-Trace: news.nyu.edu 902545250 5889 (None) 128.122.140.58 Organization: New York University Newsgroups: comp.lang.ada Date: 1998-08-07T00:00:00+00:00 List-Id: 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