From owner-freebsd-questions Thu Dec 5 5:26:46 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6A15937B401 for ; Thu, 5 Dec 2002 05:26:45 -0800 (PST) Received: from bessel.tekniikka.turkuamk.fi (bessel.tekniikka.turkuamk.fi [193.166.133.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6344943ECF for ; Thu, 5 Dec 2002 05:26:44 -0800 (PST) (envelope-from eyurtese@bessel.tekniikka.turkuamk.fi) Received: from localhost (eyurtese@localhost) by bessel.tekniikka.turkuamk.fi (8.9.2/8.9.2) with ESMTP id PAA117788; Thu, 5 Dec 2002 15:26:39 +0200 Date: Thu, 5 Dec 2002 15:26:38 +0200 (WET) From: Evren Yurtesen To: David Schultz Cc: freebsd-questions@FreeBSD.ORG Subject: Re: -O3 optimization? In-Reply-To: <20021205131130.GB11161@HAL9000.homeunix.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Well, I made searches from google and people talk that O3 produced quite noticably faster code. But well I am not so hungry for speed. I just wondered if the binary might have something wrong with it or not even though the compiler didnt complain while compiling. What about using -O or not using any optimizations? Is it very rare that -O breaks somethings? I was using -Os and I also didnt notice anything wrong but maybe there can be something I am missing too... Is there big performance improvement between -O and -O2 ? or from not using any optimizations to -O or -O2? Lets say if I am compiling KDE,XFree86. How much would it effect? is there a web page with some statistical data about this? Evren On Thu, 5 Dec 2002, David Schultz wrote: > Thus spake Evren Yurtesen : > > I wonder if a source is compiled with -O3 without any problems, might > > there be any problems in binaries which might create crashes? > > You're welcome to try it out, but it isn't supported. GCC has a > few obscure misfeatures at -O3. Some applications break at -O3, > usually because they violate C's aliasing rules or contain broken > inline assembly. At one point, the kernel's TCP checksum code had > some difficult-to-solve problems with -O3, and I'm not sure > whether that has been fixed. > > Despite all of that, I built world and kernel with -O2 a while ago > and noticed no problems whatsoever. Just note that you've been > warned, and you probably won't see a significant performance > improvement anyway. > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message