From owner-freebsd-stable@FreeBSD.ORG Wed Sep 13 10:08:55 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 AD6AA16A403 for ; Wed, 13 Sep 2006 10:08:55 +0000 (UTC) (envelope-from freebsd-stable@voidcaptain.com) Received: from mx4.x15.net (mx4.x15.net [69.55.237.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 68E0243D45 for ; Wed, 13 Sep 2006 10:08:55 +0000 (GMT) (envelope-from freebsd-stable@voidcaptain.com) Received: from j1.x15.net [63.196.213.76] by mx4.x15.net with ESMTP id 608060222X1GNRfq0006AT5J; Wed, 13 Sep 2006 10:08:54 +0000 Message-ID: <4507D897.4030502@voidcaptain.com> Date: Wed, 13 Sep 2006 03:08:23 -0700 From: Pete Slagle MIME-Version: 1.0 To: olli@lurza.secnetix.de References: <200609130905.k8D95idk062789@lurza.secnetix.de> In-Reply-To: <200609130905.k8D95idk062789@lurza.secnetix.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-stable@Freebsd.org 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: Wed, 13 Sep 2006 10:08:55 -0000 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. /etc/make.conf on most of my 6.1 machines contains (in part) this: CFLAGS= -O2 -pipe -fno-strict-aliasing COPTFLAGS= -O2 -pipe I no longer remember exactly why, but at some point I must have understood or assumed that to be the recommendation. Just to be completely clear, are you saying that this CFLAGS= -O2 -pipe -fno-strict-aliasing COPTFLAGS= -O2 -pipe -fno-strict-aliasing would be better in the general case?