[GIT-PULLS] [php-src] PR #23054: Fix GH-22206: avoid musttail in zend_runtime_jit() in the tail-call VM

[email protected] (lazerg)
Newsgroups php.git-pulls
Message-ID <[email protected]>
Pull Request: https://github.com/php/php-src/pull/23054
Author: lazerg

With `--disable-gcc-global-regs` and a compiler that supports `preserve_none`, opcache is built with `ZEND_VM_KIND_TAILCALL`, where `ZEND_OPCODE_RETURN()` expands to a guaranteed tail call. `zend_runtime_jit()` does its work inside `zend_try()`, which uses `setjmp()`, and GCC 16 rejects that combination with "cannot tail-call: caller uses setjmp".

GH-22320 fixed the `--enable-gcc-global-regs` side of the same report. Here the tail call isn't needed: `zend_runtime_jit()` is a cold one-shot JIT trigger rather than a hot VM handler, so a plain call works and the returned opline still goes back to the VM loop as before.

Checked with GCC 16.1.0: a `--disable-gcc-global-regs` build fails on `ext/opcache/jit/zend_jit.lo` before the change and compiles after it. ext/opcache and Zend tests pass on a tail-call VM build.

Fixes GH-22206
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.