]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43166: Disable ceval.c optimizations for Windows debug builds (GH-32023)
authorneonene <53406459+neonene@users.noreply.github.com>
Wed, 23 Mar 2022 00:35:25 +0000 (09:35 +0900)
committerGitHub <noreply@github.com>
Wed, 23 Mar 2022 00:35:25 +0000 (00:35 +0000)
Also increases the stack allocation when run with `python_d.exe` to account for the extra stack checks that are added.

Include/pyport.h
PCbuild/python.vcxproj
Python/ceval.c

index 62ac0989d3f154f447780cab484dbefe739548d3..855c382a61ee53fc2fc3da311537f6fc77355835 100644 (file)
@@ -170,23 +170,12 @@ typedef Py_ssize_t Py_ssize_clean_t;
  * Py_LOCAL_INLINE does the same thing, and also explicitly requests inlining,
  * for platforms that support that.
  *
- * If PY_LOCAL_AGGRESSIVE is defined before python.h is included, more
- * "aggressive" inlining/optimization is enabled for the entire module.  This
- * may lead to code bloat, and may slow things down for those reasons.  It may
- * also lead to errors, if the code relies on pointer aliasing.  Use with
- * care.
- *
  * NOTE: You can only use this for functions that are entirely local to a
  * module; functions that are exported via method tables, callbacks, etc,
  * should keep using static.
  */
 
 #if defined(_MSC_VER)
-#  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 */
 #  pragma warning(disable: 4710)
    /* fastest possible local call under MSVC */
index 77bccde69e3ba3baca585e0f193ab8538da8f532..11f835aecea7dceda82da3b3bb297507fffdb4a9 100644 (file)
@@ -94,7 +94,8 @@
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
-      <StackReserveSize>2000000</StackReserveSize>
+      <StackReserveSize Condition="$(Configuration) != 'Debug'">2000000</StackReserveSize>
+      <StackReserveSize Condition="$(Configuration) == 'Debug'">4000000</StackReserveSize>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
index 73179c810b7e5e58580f24511036ef42bc29fba6..42925b5b6304898ae4b93e2d540ba7a389abcbca 100644 (file)
@@ -5,10 +5,6 @@
    XXX document it!
    */
 
-/* enable more aggressive intra-module optimizations, where available */
-/* affects both release and debug builds - see bpo-43271 */
-#define PY_LOCAL_AGGRESSIVE
-
 #include "Python.h"
 #include "pycore_abstract.h"      // _PyIndex_Check()
 #include "pycore_call.h"          // _PyObject_FastCallDictTstate()