Skip to content

Commit a95c401

Browse files
Address Victor review
Co-Authored-By: Victor Stinner <vstinner@python.org>
1 parent 4b79670 commit a95c401

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

Doc/using/configure.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,12 @@ Compiler flags
15741574

15751575
.. versionadded:: 3.7
15761576

1577+
.. envvar:: CFLAGS_CEVAL
1578+
1579+
Flags used to compile ``Python/ceval.c``.
1580+
1581+
.. versionadded:: 3.14.5
1582+
15771583
.. envvar:: CCSHARED
15781584

15791585
Compiler flags used to build a shared library.

configure

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7374,10 +7374,10 @@ fi
73747374
AC_MSG_CHECKING([if we need to manually block large inlining in ceval.c])
73757375
AC_RUN_IFELSE([AC_LANG_SOURCE([[
73767376
int main(void) {
7377-
// See gh-148284:
7378-
// Clang 22 seems to have interactions with inlining and the stackref buffer
7379-
// which cause 40kB of stack usage on x86-64 in buggy versions of _PyEval_EvalFrameDefault
7380-
// in computed goto interpreter. The normal usage seen is normally 1-2kB.
7377+
// See gh-148284: Clang 22 seems to have interactions with inlining
7378+
// and the stackref buffer which cause 40 kB of stack usage on x86-64
7379+
// in buggy versions of _PyEval_EvalFrameDefault() in computed goto
7380+
// interpreter. The normal usage seen is normally 1-2 kB.
73817381
#if defined(__clang__) && (__clang_major__ == 22)
73827382
return 1;
73837383
#else
@@ -7391,11 +7391,11 @@ int main(void) {
73917391
AC_MSG_RESULT([$block_huge_inlining_in_ceval])
73927392

73937393
if test "$block_huge_inlining_in_ceval" = yes && test "$ac_cv_computed_gotos" = yes; then
7394-
// This number should be tuned to follow the C stack consumption
7395-
// in _PyEval_EvalFrameDefault on computed goto interpreter.
7396-
CFLAGS_CEVAL="-finline-max-stacksize=512"
7397-
else
7398-
CFLAGS_CEVAL=""
7394+
# gh-148284: Suppress inlining of functions whose stack size exceeds
7395+
# 512 bytes. This number should be tuned to follow the C stack
7396+
# consumption in _PyEval_EvalFrameDefault() on computed goto
7397+
# interpreter.
7398+
CFLAGS_CEVAL="$CFLAGS_CEVAL -finline-max-stacksize=512"
73997399
fi
74007400
AC_SUBST([CFLAGS_CEVAL])
74017401

0 commit comments

Comments
 (0)