Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Sep 2006 16:49:34 -0700
From:      Gary Kline <kline@sage.thought.org>
To:        Stefan Lambrev <stefan.lambrev@sun-fish.com>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: optimization levels for 6-STABLE build{kernel,world}
Message-ID:  <20060913234934.GA92067@thought.org>
In-Reply-To: <4507CC9B.60704@sun-fish.com>
References:  <200609130905.k8D95idk062789@lurza.secnetix.de> <4507CC9B.60704@sun-fish.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 13, 2006 at 12:17:15PM +0300, Stefan Lambrev wrote:
> Hello,
> 
> Oliver Fromme wrote:
> >Marc G. Fournier <freebsd@hub.org> 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??

	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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060913234934.GA92067>