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,37b5f16b9be86fec X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: ada -> C translator Date: 1997/04/03 Message-ID: #1/1 X-Deja-AN: 230562043 References: <33436B29.41C6@sema-grenoble.fr> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-04-03T00:00:00+00:00 List-Id: Just to give a bit more detail on the overflow issue, and a specific example. Consider the PPC architecture with its sticky bit. The proper efficient code is to compute a whole expression, or at least a cjunk of it with no calls, and then do one test of the sticky bit. There is no way I know of to persaude a C compiler to get anywhere near to optimal code. Note: the reason that I know this particular technical problem very well is that in its current form, gcc does not know how to generate efficient overflow checks. So even though we are not generating C in GNAT, we suffer from similar limitations. Yes, we can play some tricks, like ICC did, but we can't get really efficient overflow checking, not till gcc is properly taught to handle overflow (note that the reason that gcc does not know how to generate efficient overflow checking is because C does not know about overflows!) Given that gcc started life as a C code generator, one of the dynamics of the GNAT project is that we have faced many of the same problems that one would face generating C, though not all -- critically GNU C has nested procedures, which standard C does not! A critical difference is that, unlike the situation where you are stuck generating C, we can over time teach gcc to know more about Ada specific requirements. We have taught it quite a bit -- it still needs to be taught more, notably in the areas of overflow checking and exception handling.