From owner-freebsd-hackers Mon Apr 10 4: 2: 3 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from ewok.creative.net.au (fuzzy.aussie.com.au [203.30.44.82]) by hub.freebsd.org (Postfix) with SMTP id 0CBAB37B70F for ; Mon, 10 Apr 2000 04:01:55 -0700 (PDT) (envelope-from freebsd@ewok.creative.net.au) Received: (qmail 18279 invoked by uid 1008); 10 Apr 2000 11:01:51 -0000 Date: Mon, 10 Apr 2000 19:01:51 +0800 From: Adrian Chadd To: hackers@freebsd.org Subject: Re: What are the best gcc optimization options for Pentium 200 MMX Message-ID: <20000410190151.A18146@ewok.creative.net.au> References: <86snwuwk9w.fsf@not.demophon.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <86snwuwk9w.fsf@not.demophon.com>; from Ville-Pertti Keinonen on Mon, Apr 10, 2000 at 09:19:07AM +0300 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, Apr 10, 2000, Ville-Pertti Keinonen wrote: > > kris@FreeBSD.org (Kris Kennaway) writes: > > > Can you say "gimmick"? :-) gcc often produces demonstrably broken code for > > optimisation levels higher than -O. > > That -O is safe seems to be a persistent myth. GCC also produces > broken code for -O and no optimization in some cases, sometimes while > producing working code for higher optimization levels... I wouldn't > state e.g. that -O2 produces broken code any more often than -O, this > may have been true for version X.Y.Z but is certainly not universally > true. > > I believe that the reasons the FreeBSD build uses -O are the fact that > especially with older versions of gcc, -O2 slowed down compilation > considerably for little noticable performance improvement (as for -O3, > automatic inlining is generally undesirable), and it is always best to > only have to test the system with a single set of flags. I have exactly the same problem hacking squid code under 4.0-CURRENT and 5.0-CURRENT. Basically, inside the dns routines a variable would be corrupted between a couple of non-relevant lines, and cause squid to segfault after trying to resolve anything. Taknig out -O2 and replacing it with -O causes the same problem. Its annoying. :( Adrian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message