You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
We should fail to compile if _Py_TAIL_CALL_INTERP is set but preserve_none and musttail do not exist. #140513
#if_Py_TAIL_CALL_INTERP&& (defined(__clang__) || defined(__GNUC__))
# if !_Py__has_attribute(preserve_none) || !!_Py__has_attribute(musttail)
# error "This compiler does not have support for efficient tail calling."
# endif#endif
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.
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_none
How 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."
# endif
Activity
XChaitanyaX commentedon Oct 24, 2025
Can I have a pr for this?
double exclamation
!!mark?? Shouldn't it be single?chris-eibl commentedon Oct 24, 2025
Maybe we can already handle that "earlier" in configure?
Fidget-Spinner commentedon Oct 24, 2025
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.
chris-eibl commentedon Oct 24, 2025
Yeah, 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)?gh-140513: Fail to compile if `_Py_TAIL_CALL_INTERP` is set but `pres…
Fidget-Spinner commentedon Nov 1, 2025
We missed the train for 3.14. Backporting now would break GCC 15.
Fidget-Spinner commentedon Nov 2, 2025
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?
chris-eibl commentedon Nov 2, 2025
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?
How to handle that? Something like
https://godbolt.org/z/d74ozM1oE
chris-eibl commentedon Nov 2, 2025
Or better break for GCC 15 like on main?
Fidget-Spinner commentedon Nov 2, 2025
Yes just break GCC 15.
chris-eibl commentedon Nov 2, 2025
Ok, I'll take care about the manual backport.
pythongh-140513: Fail to compile if `_Py_TAIL_CALL_INTERP` is set but…
[3.14] gh-140513: Fail to compile if _Py_TAIL_CALL_INTERP is set but …
pythongh-140513: Fail to compile if `_Py_TAIL_CALL_INTERP` is set but…
GH-148047: Check early whether tail-calling is possible for MSVC buil…
pythonGH-148047: Check early whether tail-calling is possible for MSV…