Skip to content

--without-tail-call-interp actually enables the tail-call interpreter, instead of disabling! #129989

Closed

Description

@nelhage

In configure.ac, if the user passes --tail-call-interp in the negative, we set Py_TAIL_CALL_INTERP to 0:

cpython/configure.ac

Lines 7027 to 7032 in 1feaecc

if test "$withval" = no
then
AC_DEFINE([Py_TAIL_CALL_INTERP], [0],
[Define if you want to use tail-calling interpreters in CPython.])
AC_MSG_RESULT([no])
fi

However, in ceval_macros.h and bytecodes.c, we check for #ifdef Py_TAIL_CALL_INTERP and #if defined(Py_TAIL_CALL_INTERP), for instance:

#ifdef Py_TAIL_CALL_INTERP
)

Thus, defining the macro -- even with a value of 0 -- actually enables the feature! I think the consistent behavior (consistent with USE_COMPUTED_GOTOS) is probably to switch the preprocessor guards to #if, instead of #ifdef.

Linked PRs

Activity

  1. added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    buildThe build process and cross-build
    on Feb 11, 2025
  2. Fidget-Spinner commented on Feb 11, 2025

    @Fidget-Spinner
    Member

    Great catch! Will fix this.

  3. added a commit that references this issue on Feb 15, 2025
  4. Fidget-Spinner commented on Feb 16, 2025

    @Fidget-Spinner
    Member

    Should be fixed. Please do let us know if there are any further issues.

  5. added a commit that references this issue on Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions