New GitHub issue #119866 from markshannon:<br>

<hr>

<pre>
For performance we keep the stack pointer in a register, however this means that the stack pointer is invisible to debuggers and other tools. If we spill the stack pointer across "escaping" calls, then most of the time we want to inspect the evaluation the stack pointer should be in memory.
Spilling the stack pointer is also a necessary precursor to deferred reference counting: https://github.com/faster-cpython/ideas/issues/677, https://github.com/python/cpython/issues/117139

Since the C compiler needs to spill values around calls, manually spilling the stack pointer has quite a low cost. It limits the freedom of the C compiler to allocate registers, but not that much.


</pre>

<hr>

<a href="https://github.com/python/cpython/issues/119866">View on GitHub</a>
<p>Labels: </p>
<p>Assignee: </p>