[Mesa-dev] [PATCH] Revert "configure.ac: Disable compiler optimizations when --enable-debug is set"
maraeo at gmail.com
Tue Jan 8 09:27:06 PST 2013
On Tue, Jan 8, 2013 at 6:11 PM, Matt Turner <mattst88 at gmail.com> wrote:
> On Tue, Jan 8, 2013 at 8:38 AM, Marek Olšák <maraeo at gmail.com> wrote:
>> This reverts commit 122345876479cf5cf553e38162ab105658614ab7.
>> Some distributions use --enable-debug for testing packages and the commit
>> results in terrible CPU performance. It can be embarrassing for us.
>> Those who do not want optimizations should set the CFLAGS and CXXFLAGS
>> environment variables. In my opinion, --enable-debug should only set -DDEBUG.
> Dan's two patches from yesterday handle this while still setting -O0
> if CFLAGS don't contain -O*. Do those patches work for your purposes?
> The problem here is that we're just going back and forth on this
> behavior and both behaviors are reasonable for different things.
The problem is that we try to set -O0 for --enable-debug and I don't
like that and I'm not the only one. If you want -O0, you should add
another flag e.g. --disable-optimizations. The default behavior should
always be -O2, because I always want optimizations, but I also want to
sometimes turn on assertions and other run-time checks depending on
Also, people expect a certain behavior from --enable-debug and we
shouldn't change that.
Adding --disable-optimizations is the way to go for those who need -O0.
More information about the mesa-dev