Skip to content

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

@nelhage

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

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