[3.14] gh-148284: Block inlining of gigantic functions in ceval.c for clang 22#148326
Open
Fidget-Spinner wants to merge 2 commits intopython:3.14from
Open
[3.14] gh-148284: Block inlining of gigantic functions in ceval.c for clang 22#148326Fidget-Spinner wants to merge 2 commits intopython:3.14from
Fidget-Spinner wants to merge 2 commits intopython:3.14from
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It seems that on clang-22, the inliner is too aggressive on _PyEval_EvalFrameDefault when on computed goto interpreter. Together with some strange interaction with the stackref buffer, the function requires 40kB of stack space (!!!) versus the usual 1-2kB normally used.
This sets the inline limit to functions of max 512B stack space (1/4th of normal) allowed to be inlined in
ceval.c. I checked the dissasembly and the new function uses about 2kB of stack.This will need a forward-port to 3.15 too.
python -m test -v test_callsegfault with clang 22.1.3 build #148284