[Bug target/119628] Need better mechanisms to manage register saves in callee for tail calls (inc. preserve_none for x86_64?)
kenjin4096 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Jun 26 14:21:04 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119628
--- Comment #22 from Ken Jin <kenjin4096 at gmail dot com> ---
Hi H.J,
Thanks a lot for your work on this. I get a crash due to a possible miscompile
on the latest GCC commit (7c67f7f8d4c8aadbe8efd733c29d13bfcbb0f50f).
Unfortunately, I cannot create a minimal reproducer right now, but something
strange is going at the boundary where a normal function calls a preserve_none
function, and where a preserve_none function returns back to the non
preserve_none function. An interesting observation: passing
`-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer` seems to produce a
working binary that doesn't crash.
The call stack at the crash is something like _PyEval_EvalFrameDefault (not
tail call, not preserve_none) -> _TAIL_CALL_start_frame (preserve_none) ->
(indeterminate number of tail calls, preserve_none) ->
_TAIL_CALL_INTERPRETER_EXIT (preserve_none)
_TAIL_CALL_INTERPRETER_EXIT function contains a bare return out of the tail
call sequence.
More information about the Gcc-bugs
mailing list