Repository navigation
We should fail to compile if _Py_TAIL_CALL_INTERP is set but preserve_none and musttail do not exist. #140513
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Oct 23, 2025 - addedinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)buildThe build process and cross-buildThe build process and cross-build
on Oct 23, 2025 - added3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixes
on Oct 23, 2025 Can I have a pr for this?
!!_Py__has_attribute(musttail)
double exclamation
!!mark?? Shouldn't it be single?Maybe we can already handle that "earlier" in configure?
Maybe we can already handle that "earlier" in configure?
This works too but I'd rather bloat up our C code rather than the configure code. The configure script is already pretty complex so I don't like adding more to it.
Reacted by Chris EiblYeah, and we could handle MSVC (#139962) here then in a similar way, too.
E.g. include a check for
_MSC_VERlike#if defined(_MSC_VER) && (_MSC_VER < 1950)?Reacted by Ken Jin- added a commit that references this issue
on Nov 1, 2025 We missed the train for 3.14. Backporting now would break GCC 15.
We need to backport this to 3.14 as well. The macro name has changed there. Can someone take care of the manual backport please?
Yeah, #139120 did not get backported.
I think it would be best to start fresh over against 3.14, cherry picker would be no help?
Also because the MSVC part shouldn't be part of it or needs extra care, too?We missed the train for 3.14. Backporting now would break GCC 15.
which has musttail but no preserve_noneHow to handle that? Something like
// GCC 15 has support for musttail, but not for preserve_none. // Because we previously have allowed this, let's continue to do so. # if defined(__clang__) || defined(__GNUC__) # if !_Py__has_attribute(preserve_none) || !_Py__has_attribute(musttail) # if (__GNUC__ != 15) # error "This compiler does not have support for efficient tail calling." # endif # endif # elif defined(_MSC_VER) # error "tail calling is not supported for MSVC." # endifOr better break for GCC 15 like on main?
Yes just break GCC 15.
Reacted by Chris EiblOk, I'll take care about the manual backport.
Reacted by Ken Jin- added a commit that references this issue
on Nov 4, 2025 - added a commit that references this issue
on Apr 12, 2026
Bug report
Bug description:
The code should look something like this:
CPython versions tested on:
CPython main branch, 3.15, 3.14
Operating systems tested on:
No response
Linked PRs
_Py_TAIL_CALL_INTERPis set butpreserve_noneandmusttaildo not exist. #140548