[issue8625] --with-pydebug builds now include -O2 by default

Mark Dickinson report at bugs.python.org
Wed May 5 16:03:50 CEST 2010


New submission from Mark Dickinson <dickinsm at gmail.com>:

When doing a debug build of Python with gcc, without any previous setting of CFLAGS, the '-O2' flag is now automatically included.

This behaviour started in r79218.

It would be nice to restore the original behaviour, if possible, since the optimization causes difficulties when debugging.  One solution would be to add '-O0' to OPT for debug builds (on gcc), as in the attached patch.  You then get compiler flags including:

"-g -O2 -g -O0"

which is somewhat ugly, but the -O0 overrides the -O2 (I think).  Does this seem like a reasonable solution?

----------
components: Build
files: no_debug_optimization.patch
keywords: patch
messages: 105035
nosy: haypo, lemburg, mark.dickinson, pitrou
priority: normal
severity: normal
status: open
title: --with-pydebug builds now include -O2 by default
type: behavior
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file17219/no_debug_optimization.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8625>
_______________________________________


More information about the Python-bugs-list mailing list