From owner-freebsd-arch@FreeBSD.ORG Sat Jul 27 07:24:31 2013 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5ABE2AB2 for ; Sat, 27 Jul 2013 07:24:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A51AC2AA6 for ; Sat, 27 Jul 2013 07:24:30 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA05424 for ; Sat, 27 Jul 2013 10:24:29 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1V2yrc-000NCK-MV for freebsd-arch@freebsd.org; Sat, 27 Jul 2013 10:24:28 +0300 Message-ID: <51F37578.2080405@FreeBSD.org> Date: Sat, 27 Jul 2013 10:23:36 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130708 Thunderbird/17.0.7 MIME-Version: 1.0 To: freebsd-arch@FreeBSD.org Subject: Re: amd64: -O2 even with DEBUG References: <51F221D4.8040308@FreeBSD.org> <20130726185425.GS26412@funkthat.com> In-Reply-To: <20130726185425.GS26412@funkthat.com> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 07:24:31 -0000 on 26/07/2013 21:54 John-Mark Gurney said the following: > Andriy Gapon wrote this message on Fri, Jul 26, 2013 at 10:14 +0300: >> I wonder why amd64 is distinguished to have -O2 in COPTFLAGS even when DEBUG is >> defined. For all other archs it's -O for that case. >> >> Perhaps, this was discussed / explained in the past, but I would appreciate it >> being said again (or even written as a comment in kern.pre.mk). > > It's probably because at least gcc produces terrible amd64 code w/o > it... It will constantly reload the register it uses to do relative > loads w/ the same value even though nothing changed... makes performance > suck... Well, we are talking about the DEBUG case. So I am not sure if better performance has more importance than better debugging. And I believe that -O2 does make debugging harder. -- Andriy Gapon