From owner-freebsd-stable@FreeBSD.ORG Thu Sep 14 00:02:44 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 49E4916A403 for ; Thu, 14 Sep 2006 00:02:44 +0000 (UTC) (envelope-from Mark_Andrews@isc.org) Received: from farside.isc.org (farside.isc.org [204.152.187.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id F33BF43D46 for ; Thu, 14 Sep 2006 00:02:43 +0000 (GMT) (envelope-from Mark_Andrews@isc.org) Received: from drugs.dv.isc.org (localhost.isc.org [IPv6:::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by farside.isc.org (Postfix) with ESMTP id 5F585E6084 for ; Thu, 14 Sep 2006 00:02:43 +0000 (UTC) (envelope-from marka@isc.org) Received: from drugs.dv.isc.org (localhost [127.0.0.1]) by drugs.dv.isc.org (8.13.8/8.13.6) with ESMTP id k8E02b11073990; Thu, 14 Sep 2006 10:02:38 +1000 (EST) (envelope-from marka@drugs.dv.isc.org) Message-Id: <200609140002.k8E02b11073990@drugs.dv.isc.org> To: Gary Kline From: Mark Andrews In-reply-to: Your message of "Wed, 13 Sep 2006 16:49:34 MST." <20060913234934.GA92067@thought.org> Date: Thu, 14 Sep 2006 10:02:37 +1000 Sender: Mark_Andrews@isc.org Cc: freebsd-stable@freebsd.org, Stefan Lambrev Subject: Re: optimization levels for 6-STABLE build{kernel,world} X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 00:02:44 -0000 > On Wed, Sep 13, 2006 at 12:17:15PM +0300, Stefan Lambrev wrote: > > Hello, > > > > Oliver Fromme wrote: > > >Marc G. Fournier wrote: > > > > What are ppl currently using for CFLAGS/COPTFLAGS in /etc/make.conf for > > > > > building kernel/world? I know awhile back it wasn't recommended to go > > > > above -O2, for instance, but suspect that has changed ... ? > > > > > >The best optimization is probably to not override the > > >defaults at all, because they're already pretty optimal. > > >In fact, by overriding the defaults there's a good chance > > >to make things worse. :-) > > > > > >The default CFLAGS are "-O2 -pipe -fno-strict-aliasing". > > >Anything above -O2 isn't supported, and using -O2 without > > >-fno-strict-aliasing also isn't supported (and will create > > >broken code for some programs). A common mistake is to > > >specify CFLAGS="-O2 -pipe" and omit -fno-strict-aliasing. > > >That'll shot you in the foot sooner or later. > > > > > >Best regards > > > Oliver > > > > > > > > May be default flags have to be set here: > > /usr/src/share/examples/etc/make.conf ? > > I'm asking because in this file I read: > > > > # CFLAGS controls the compiler settings used when compiling C code. > > # Note that optimization settings other than -O and -O2 are not recommended > > # or supported for compiling the world or the kernel - please revert any > > # nonstandard optimization settings to "-O" or -O2 before submitting bug > > # reports without patches to the developers. > > # > > #CFLAGS= -O -pipe > > > > May be "-fno-strict-aliasing" have to be added here then ? > > > > > A couple of things. Will having gcc unroll loops have any > negative consequences? (I can't imagine how:: but better > informed than to have something crash inexplicability.) > With 6.X safe at -O2 and with -funroll-loops, that should be > a slight gain, right? (It also will make an upgrade from 5.5 > to 6.[12] that much more rational.) > > [Dumb] questions:: first, what does the compiler do with > "-fno-strict-aliasing"? And is there any guess, any SWAG even, > on when FreeBSD will safe with -O3?? Lots of code is not strict-aliasing safe. Gcc itself can't determine all the cases which a construct is not strict-aliasing safe so even after getting rid of all the warnings gcc produces you can't be sure your code is strict-aliasing safe. Think of -fstrict-aliasing as optimisation without a saftey net. If your code doesn't cast pointers you should be safe otherwise you need to be really, really, really careful when you turn this on. > thanks, people, > > gary > > > -- > > Best Wishes, > > Stefan Lambrev > > ICQ# 24134177 > > > > _______________________________________________ > > freebsd-stable@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" > > -- > Gary Kline kline@thought.org www.thought.org Public service Unix > > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" -- ISC Training! October 16-20, 2006, in the San Francisco Bay Area, covering topics from DNS to DHCP. Email training@isc.org. -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: Mark_Andrews@isc.org