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,bcab66d98d510478 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Optimization Defaults Date: 1999/12/19 Message-ID: <83hivi$fb1$1@nnrp1.deja.com>#1/1 X-Deja-AN: 562449736 References: <38553cf0.22235803@newsnew.draper.com> X-Http-Proxy: 1.0 x23.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Sun Dec 19 03:21:24 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-19T00:00:00+00:00 List-Id: In article <38553cf0.22235803@newsnew.draper.com>, rracine@myremarq.com (Roger Racine) wrote: > Based on Robert Dewar's strong statement to trust the GCC optimizer, > and based on my own knowledge of the use of the optimizer when > building GCC itself, I suggested that there should be no problem using > -O2 for GCC on a current project. Immediately someone said that he > had gotten burned using GCC a couple years ago (version 2.7.2, I > believe he said he was using) in two different ways (using C, but the > optimizer is common, right?). No one claimed that there was no possibility of bugs that cause the compiler to malfunction at one optimization level where it succeeds at another. But the point is: 1) There are relatively few such problems because the gcc backend is pretty mature at this stage. 2) Going from -O0 to -O2 is by no means a guarantee that the number of such bugs will increase, we have seen (rarely, but then optimization bugs are rare in general) cases in which a bug appeared only at -O0 and disappeared at -O2. One thing to be aware of is that the punishment for erroneous code is often more severe at -O2, so if you write junk code, you may well find that the code appears to "work" at -O0 and appears to "fail" at -O2. In such cases, using -O2 is actually helpful in helping to smoke out such bugs Sent via Deja.com http://www.deja.com/ Before you buy.