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,362cb73a2f180232 X-Google-Attributes: gid103376,public From: dennison@telepath.com Subject: Re: How does GNAT (or GCC) compile ADA code? Date: 1998/10/22 Message-ID: <70nqr2$90b$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 403969567 References: <707h7o$cvl$1@nnrp1.dejanews.com> <70lttj$mrp@netline.jpl.nasa.gov> X-Http-Proxy: 1.0 x14.dejanews.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Thu Oct 22 17:42:58 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.05 [en] (WinNT; I) Date: 1998-10-22T00:00:00+00:00 List-Id: In article <70lttj$mrp@netline.jpl.nasa.gov>, vsnyder@vanpcjpl.nasa.gov (Van Snyder) wrote: > In article <707h7o$cvl$1@nnrp1.dejanews.com>, dennison@telepath.com writes: > > So here's what gnat does. It converts (translates, compiles, whatever term > > you prefer) Ada source code into the special intermediate form that the gcc > > backend understands. Then it has the gcc backend do optimizations and machine > > code generation. > > Does the gcc backend understand that C and C++ pointers can point _anywhere_, > while Ada and Fortran 90 pointers are quite disciplined? The important > consequence of this observation is that optimization becomes possible. The > inability to optimize pointers is the primary reason that C and C++ programs > are generally slower than equivalent Fortran 90 programs. To my knowledge, > there are no Fortran 90 compilers that use the gcc backend. I'm sure there are folks here much better aquainted with what the gcc backend is capable of than myself. But as far as I understand it, the answer is *no*. That is why if you hang out here long enough you are bound to here Robert Dewar mention that a gcc compiled C executable should have little significant difference from a gnat compiled Ada executable if the two perform the same operations. If you know what you are doing, you can even make them produce the exact same executables. In theory that does mean gnat is missing out on a lot of extra optimization it could be doing. In practice gcc already has very good (and certianly the most thouroughly tested) optimization because of all the work that is done on it for C code. Just getting a custom back-end up to gcc's level would be a great deal of work. -- T.E.D. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own