New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--with-pydebug builds now include -O2 by default #52871
Comments
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? |
Just double checked the gcc manual. From: http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html """If you use multiple -O options, with or without level numbers, the last such option is the one that is effective.""" |
Probably good enough. |
Antoine Pitrou wrote:
+1 OPT can also be overridden by the user, to e.g. actually get an |
Applied in r80832 (trunk), r80834 (py3k). Thanks, all. |
Thanks! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: