[Python-checkins] bpo-43271: Re-enable ceval.c optimizations for Windows debug builds (GH-24739)

gvanrossum webhook-mailer at python.org
Wed Mar 3 22:09:56 EST 2021


https://github.com/python/cpython/commit/131d5516409791b170b09a6ef8ed8463c9b09015
commit: 131d5516409791b170b09a6ef8ed8463c9b09015
branch: master
author: db3l <db3l.net at gmail.com>
committer: gvanrossum <gvanrossum at gmail.com>
date: 2021-03-03T19:09:48-08:00
summary:

bpo-43271: Re-enable ceval.c optimizations for Windows debug builds (GH-24739)

Partially reverts commit b74396c3167cc780f01309148db02709bc37b432

The optimizations are necessary to prevent the interpreter from
crashing in a number of tests involving recursion.

files:
M Include/pyport.h
M Python/ceval.c

diff --git a/Include/pyport.h b/Include/pyport.h
index 0993b545dc236..fe27fbc748322 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -182,8 +182,9 @@ typedef int Py_ssize_clean_t;
  */
 
 #if defined(_MSC_VER)
-#  if defined(PY_LOCAL_AGGRESSIVE) && !defined(Py_DEBUG)
+#  if defined(PY_LOCAL_AGGRESSIVE)
    /* enable more aggressive optimization for MSVC */
+   /* active in both release and debug builds - see bpo-43271 */
 #  pragma optimize("gt", on)
 #endif
    /* ignore warnings if the compiler decides not to inline a function */
diff --git a/Python/ceval.c b/Python/ceval.c
index 8ec00bc2400fb..abdea1de09b43 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -7,6 +7,7 @@
    */
 
 /* enable more aggressive intra-module optimizations, where available */
+/* affects both release and debug builds - see bpo-43271 */
 #define PY_LOCAL_AGGRESSIVE
 
 #include "Python.h"



More information about the Python-checkins mailing list