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,325a055bed62c230 X-Google-Attributes: gid103376,public From: rracine@myremarq.com (Roger Racine) Subject: Re: Apex vs GNAT on solaris Date: 1999/12/08 Message-ID: <384e52db.779218947@newsnew.draper.com>#1/1 X-Deja-AN: 558137111 References: <82hiuj$74o$1@nnrp1.deja.com> <82hnll$ahu$1@nnrp1.deja.com> <384cfdb3.691883075@newsnew.draper.com> <82ku6s$jhi$1@nnrp1.deja.com> X-Complaints-To: abuse@draper.com X-Trace: newsnew.draper.com 944660986 16207 140.102.40.31 (8 Dec 1999 13:49:46 GMT) NNTP-Posting-Date: 8 Dec 1999 13:49:46 GMT Newsgroups: comp.lang.ada Date: 1999-12-08T13:49:46+00:00 List-Id: On Wed, 08 Dec 1999 06:35:08 GMT, Robert Dewar wrote: >In article <384cfdb3.691883075@newsnew.draper.com>, > rracine@myremarq.com (Roger Racine) wrote: >> Many people will assume that the default options are the most >> reliable options. > >They will assume wrong. For example, in the case of GNAT, >we let -O0 be the default because that is traditional in >all gcc compilers. We make inlining off the default, because >that seems more compatible with -O0 as the default. > That is a pretty questionable reason for creating a default. Perhaps compiler documentation should state reasons for using the various options. Of course, a given vendor might not want to say "turn optimization on only as a last resort, since it is not well tested", but certainly ACT (from what you say) should tell their users to turn it on. >> Others will assume that the default options are the best >> options. > >They will assume wrong, there is no "best options", there is >only the appropriate options for your particular use. > I do not know about your experience, but for me, with embedded system compilers (which tend to have comparatively few users compared to workstation compilers), for numerous languages over the years, it has always been dangerous to change the default optimization options. ACT might want to reconsider their default. >> The default options generally turn out to be the most >> reliable because most people use them > >Not true in the GCC/GNAT world, virtually all users plan on >setting at least -O1 for actual production work (-O0 is almost >never suitable for production work, it is usually only used >while debugging, since it is easier to debug unoptimized code). > How do you know this? As an ACT user, I have never been asked about my settings (-O2). And the GCC world is pretty big. You certainly have not asked all those users. >> and bugs will be discovered and corrected sooner than those to >> be found using the non-default options. > >Well you may guess this, but it is wrong for gcc. Far more code >is run with optimization on. It is not common to find bugs that >depend on the optimization level in the gcc technology (since >the backend is mature), but when they do arise, they are just >as likely to be bugs that show up ONLY with optimization off. > This is not a guess, it is my experience with other compilers. And, as you have said many times, do not believe everything you read on newsgroups. :-) As I said above, for GNAT I personally do use -O2, but only because I did a bit of checking (such as the optimization level used in your Make files and for the ACVC tests, or whatever they are called now), but there are many others who have similar experiences and have not done any checking. They will use the default. By the way, why don't you use -O3? >> The same can be said for tasking. > >Again, this can be misleading. For example, on Solaris, the >system thread support is definitely buggy, and indeed we have >found it impossible to provide full Annex D support on Solaris, >even in realtime mode (it is out of the question in non-real >time, i.e. non-root mode). The FSU threads is FAR more reliable. >The choice of defaults is not based on reliability or accuracy >[which would dictate FSU], but usability, most people want to >use system threads [I assume this is what you mean by Posix >threads, your designation is confusing, since of course FSU >is also Posix compliant]. > This is confused. My message said nothing about Posix vs FSU. But you seem to be agreeing with me that it is better to use the default for threads. By the way, unless you have changed something, your version of FSU Threads is -not- Posix compliant, as we have discussed previously. ACT is using an old version that was based on one of the proposed Posix standards. >> and generally assum that the compiler vendors knows what they >> are doing when the defaults are created. > >We know EXACTLY what we are doing when we create the defaults, >it just does not happen to correspond to any of your guesses. > Nor does it seem to indicate much logic. "We do it because everyone else using the common back end does it. We certainly do not want anyone to use the default." :-) >> They are giving what they think should be the most >> common values for the options. > >Nope, that's plain wrong in the case of gcc! The important thing >in our mind is to be consistent with other uses of gcc, so that >the usage will be the same for GNAT, gnu C, g++ etc. How would the usage be different if you had a different (better) default? For gnu C, users would need to say "gcc -O1 XXX.c" to get the first level of optimization. For Ada, users could say the same thing, or they could say "gcc XXX.adb" to get that same level (assuming your default were -O1). Why do you consider that to be an overriding reason? Roger Racine