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,dd5ebdd28e541cfa X-Google-Attributes: gid103376,public From: Preben Randhol Subject: Re: Gnat optimizes better than gcc C? Date: 1999/12/17 Message-ID: #1/1 X-Deja-AN: 561983971 References: <385800DC.DE033376@lisco.com> <3859a321.0@news.pacifier.com> <83djjr$qqo$1@nnrp1.deja.com> X-Complaints-To: usenet@itea.ntnu.no X-Trace: kopp.stud.ntnu.no 945447001 9189 129.241.83.82 (17 Dec 1999 16:10:01 GMT) Organization: ProgramVareVerkstedet NNTP-Posting-Date: 17 Dec 1999 16:10:01 GMT Newsgroups: comp.lang.ada Date: 1999-12-17T16:10:01+00:00 List-Id: Ted Dennison writes: | In article <3859a321.0@news.pacifier.com>, | "DuckE" wrote: | > Check out "The Big Online Book of Linux Ada Programming" at | > http://www.vaxxine.com/pegasoft/homes/kburtch.html | | | Hmm. Section 7.4 shows an example of an algorithm coded in Ada and C | where the optimizer can make the Ada code run twice as fast as the C. I | knew it was theoreticaly possible for this to happen, due to the extra | info Ada's types provide the compiler. However, I was under the | impression that Gnat/gcc wasn't able to take advantage of this | information. Is this right? I do not know, but I compiled the Ada and C programs as is with -O3 for C and -O3 -gnatp for Ada this gave 23 seconds for the C program and 28 seconds for Ada. Including pragma pack(atype) reduced the time for the Ada program to about 7 seconds. I didn't not include any pentium opt. flags. But isn't it a bit dubious to use a benchmark that produces an overflow error? -- Preben Randhol -- [randhol@pvv.org] -- [http://www.pvv.org/~randhol/] "Det eneste trygge stedet i verden er inne i en fortelling." -- Athol Fugard