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, MSGID_RANDY 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: Robert Dewar Subject: Re: Apex vs GNAT on solaris Date: 1999/12/08 Message-ID: <82ku6s$jhi$1@nnrp1.deja.com>#1/1 X-Deja-AN: 557811963 References: <82hiuj$74o$1@nnrp1.deja.com> <82hnll$ahu$1@nnrp1.deja.com> <384cfdb3.691883075@newsnew.draper.com> X-Http-Proxy: 1.0 x27.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Wed Dec 08 06:35:08 1999 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-12-08T00:00:00+00:00 List-Id: In article <384cfdb3.691883075@newsnew.draper.com>, rracine@myremarq.com (Roger Racine) wrote: > Is it a mistake to use the default options for a compiler? Yes, it is a mistake if the default options do not correspond to your needs, there are many options available. > 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. > 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. > 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). > 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. > 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]. > I have been hit many times by optimizer bugs Yes, that is true of many compilers, especially those with Ada specific home spun code generators, but even there I think this is mostly a historic factor, perhaps users of non-GNAT technologies can comment ... Certainly there are some old Ada 83 compilers that show this phenomenon. We have several customers who report they cannot use their old Ada 83 compilers with optimization on for this reason. But to repeat, gcc is almost always used with optimization on, except when doing initial debugging, so this kind of reliability problem is not an issue. Once again, I am not saying that there is no such thing as an optimization bug in the gcc technology, we have occasionally run into such bugs and fixed them. The point is that turning optimization ON is just as likely to remove bugs as to cause them (and both are low probability events). > 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. > 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. Robert Dewar Ada Core Technologies Sent via Deja.com http://www.deja.com/ Before you buy.