From owner-freebsd-toolchain@FreeBSD.ORG Tue May 31 13:30:38 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A57F106564A for ; Tue, 31 May 2011 13:30:38 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 141BB8FC12 for ; Tue, 31 May 2011 13:30:37 +0000 (UTC) Received: by pwj8 with SMTP id 8so2586205pwj.13 for ; Tue, 31 May 2011 06:30:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:references:in-reply-to:mime-version :content-transfer-encoding:content-type:message-id:cc:x-mailer:from :subject:date:to; bh=4D2Tk7ynIckQ02ADSQDYOl+6bKpZF+l/3gettiq9qUs=; b=WP4AIyiIonYsT4aVJaStgGwAmd2qh5I9sXHhJF1MiKYwUCOY9sQZLtSxAaTdQvg+J4 nTlIQBkTnqmPRd37U6qzRqEDWtudPUWfOfe2q1lLMU6KUk0cMFTGCFpiF+jajFG4a9ld TE6fQWuckT7VM4RAZH88Jcdk1MuoUXLV5DUE8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; b=mPZjvHF94ttUmGGXk6F/B6Nb72PfcpUrM/Bdcj/mH9qESOTDGsJLZ9LISYrCUURb/h m8yPOxSSGAUafllSKYRbZN3eAift03fHFKuzuXC764NrYe2R8WmZU0fwLcut48fgz2SV 9VqpGNi8lg43uCGU+5Bih0oWxoKTOdvE55Bpk= Received: by 10.68.14.74 with SMTP id n10mr1211710pbc.489.1306846921094; Tue, 31 May 2011 06:02:01 -0700 (PDT) Received: from [192.168.20.56] (c-24-6-49-154.hsd1.ca.comcast.net [24.6.49.154]) by mx.google.com with ESMTPS id i7sm35345pbj.10.2011.05.31.06.01.58 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 31 May 2011 06:01:59 -0700 (PDT) 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> <4DE4C4CC.4020905@FreeBSD.org> <20110531104639.GA4218@freebsd.org> In-Reply-To: <20110531104639.GA4218@freebsd.org> Mime-Version: 1.0 (iPhone Mail 8J2) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <24ADBA34-A5FC-4A67-8D6F-3BDAE158285C@gmail.com> X-Mailer: iPhone Mail (8J2) From: Garrett Cooper Date: Tue, 31 May 2011 06:01:55 -0700 To: Alexander Best Cc: "freebsd-hackers@FreeBSD.ORG" , "freebsd-toolchain@FreeBSD.ORG" , Dimitry Andric , Pan Tsu Subject: Re: [rfc] a few kern.mk and bsd.sys.mk related changes X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2011 13:30:38 -0000 On May 31, 2011, at 3:46 AM, Alexander Best wrote: > On Tue May 31 11, Dimitry Andric wrote: >> On 2011-05-31 11:57, Alexander Best wrote: >> ... >>>>> however i've often read messages - mostly by bruce evans - claiming th= at >>>>> anything greater than -O will in fact decrease a kernel's ability to b= e >>>>> debugged just as well as a kernel with -O. >>>> The critical option when -O2 is used is -fno-omit-frame-pointers, since= =20 >>>> removing >>>> frame pointers makes debugging impossible (on i386). With -O2 code is=20= >>>> 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-aliasi= ng=20 >>> as >>> standard COPTFLAGS with debugging enabled for *all* archs? >>=20 >> Most likely, the performance gain from -O2 is rather small, except for >> special cases, but the pain during debugging is increased a great deal. >>=20 >> 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. >=20 > *lol* we're moving in circles. so back to the beginning: why not use -O > for all archs, if debugging was enabled? for amd64 -O2 is always set, no > matter, if debugging is enabled or disabled. I don't know, but I've run into cases where gcc has inlined or shuffled arou= nd code on amd64 with -O2 -fno-strict-aliasing, so I changed my make.conf to= use -O0 when DEBUG_FLAGS was defined. Thanks, -Garrett=