From owner-freebsd-hackers@FreeBSD.ORG Tue May 31 10:37:06 2011 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90FD5106564A; Tue, 31 May 2011 10:37:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 179008FC14; Tue, 31 May 2011 10:37:06 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:4518:389f:3ae0:4d26] (unknown [IPv6:2001:7b8:3a7:0:4518:389f:3ae0:4d26]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 0EDFD5C37; Tue, 31 May 2011 12:37:04 +0200 (CEST) Message-ID: <4DE4C4CC.4020905@FreeBSD.org> Date: Tue, 31 May 2011 12:37:00 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18pre) Gecko/20110527 Lanikai/3.1.11pre MIME-Version: 1.0 To: Alexander Best References: <20110527115147.GA73802@freebsd.org> <3BF63174-1B29-4A4D-96DD-3ED65ED96EAC@bsdimp.com> <20110527181459.GA29908@freebsd.org> <20110527182906.GA31871@freebsd.org> <86oc2mlsey.fsf@gmail.com> <20110528182326.GA75447@freebsd.org> <20110528202619.GA27204@muon.cran.org.uk> <20110531095742.GA99888@freebsd.org> In-Reply-To: <20110531095742.GA99888@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Bruce Cran , freebsd-hackers@FreeBSD.ORG, freebsd-toolchain@FreeBSD.ORG, Pan Tsu Subject: Re: [rfc] a few kern.mk and bsd.sys.mk related changes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2011 10:37:06 -0000 On 2011-05-31 11:57, Alexander Best wrote: ... >>> however i've often read messages - mostly by bruce evans - claiming that >>> anything greater than -O will in fact decrease a kernel's ability to be >>> debugged just as well as a kernel with -O. >> The critical option when -O2 is used is -fno-omit-frame-pointers, since removing >> frame pointers makes debugging impossible (on i386). With -O2 code is moved around and >> removed, so debugging is more difficult, but can still provide useful >> information. > any reason we cannot use -O2 -fno-omit-frame-pointers -fno-strict-aliasing as > standard COPTFLAGS with debugging enabled for *all* archs? Most likely, the performance gain from -O2 is rather small, except for special cases, but the pain during debugging is increased a great deal. Even if you add frame pointers, with -O2 large pieces of code can be transformed, variables or even entire functions can be completely eliminated, and so on, making debugging much more difficult.