[php-src] PHP-8.5: Fix GH-22206: Enable the TAILCALL VM only on Clang (#23054)

From: Date: Thu, 06 Aug 2026 14:46:24 +0000
Subject: [php-src] PHP-8.5: Fix GH-22206: Enable the TAILCALL VM only on Clang (#23054)
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-140513@lists.php.net to get a copy of this message
Author: Lazizbek Ergashev (lazerg) Committer: GitHub (web-flow) Pusher: arnaud-lb Date: 2026-08-06T16:46:21+02:00 Commit: https://github.com/php/php-src/commit/949184652308d4813235f251f42342e9c7a80874 Raw diff: https://github.com/php/php-src/commit/949184652308d4813235f251f42342e9c7a80874.diff Fix GH-22206: Enable the TAILCALL VM only on Clang (#23054) Normally the TAILCALL VM is not selected on GCC as the HYBRID one takes precedence, but --disable-gcc-global-regs builds may select it. The TAILCALL VM is not supported on GCC, so enable it only on Clang. Changed paths: M Zend/zend_vm_gen.php M Zend/zend_vm_opcodes.h Diff: diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index 1ffa80f718dc..6e6349bee0ad 100755 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -2523,7 +2523,7 @@ function gen_vm_opcodes_header( $str .= "# define ZEND_VM_KIND\t\tZEND_VM_KIND_HYBRID\n"; } if ($GLOBALS["vm_kind_name"][ZEND_VM_GEN_KIND] === "ZEND_VM_KIND_HYBRID" || $GLOBALS["vm_kind_name"][ZEND_VM_GEN_KIND] === "ZEND_VM_KIND_CALL") { - $str .= "#elif defined(HAVE_MUSTTAIL) && defined(HAVE_PRESERVE_NONE) && (defined(__x86_64__) || defined(__aarch64__))\n"; + $str .= "#elif defined(HAVE_MUSTTAIL) && defined(HAVE_PRESERVE_NONE) && (defined(__x86_64__) || defined(__aarch64__)) && defined(__clang__)\n"; $str .= "# define ZEND_VM_KIND\t\tZEND_VM_KIND_TAILCALL\n"; $str .= "#else\n"; $str .= "# define ZEND_VM_KIND\t\tZEND_VM_KIND_CALL\n"; diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h index dae282705d53..34e24ec14b1e 100644 --- a/Zend/zend_vm_opcodes.h +++ b/Zend/zend_vm_opcodes.h @@ -42,7 +42,7 @@ static const char *const zend_vm_kind_name[] = { /* HYBRID requires support for computed GOTO and global register variables*/ #elif (defined(__GNUC__) && defined(HAVE_GCC_GLOBAL_REGS)) # define ZEND_VM_KIND ZEND_VM_KIND_HYBRID -#elif defined(HAVE_MUSTTAIL) && defined(HAVE_PRESERVE_NONE) && (defined(__x86_64__) || defined(__aarch64__)) +#elif defined(HAVE_MUSTTAIL) && defined(HAVE_PRESERVE_NONE) && (defined(__x86_64__) || defined(__aarch64__)) && defined(__clang__) # define ZEND_VM_KIND ZEND_VM_KIND_TAILCALL #else # define ZEND_VM_KIND ZEND_VM_KIND_CALL

« previous php.cvs (#140513) next »