Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jul 2013 10:23:36 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        freebsd-arch@FreeBSD.org
Subject:   Re: amd64: -O2 even with DEBUG
Message-ID:  <51F37578.2080405@FreeBSD.org>
In-Reply-To: <20130726185425.GS26412@funkthat.com>
References:  <51F221D4.8040308@FreeBSD.org> <20130726185425.GS26412@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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