Skip to content

Regression: AOT crc32() compile fails — AddrSpaceCast module verify (re-#1014, ext/standard/crc32.c) #27077

Description

@PurHur

Category

bug · php-src-strict · AOT · pillar 4

Problem

VM/JIT match Zend for crc32(), but AOT compile aborts during LLVM module verification (AddrSpaceCast source must be a pointer). Previously closed as working in #1014 — compile path regressed.

Repro Zend / VM / JIT (2026-08-02, dd9bde493) AOT compile
crc32('php-compiler') 4282364586 FAILRuntimeException: Module verification failed due to AddrSpaceCast source must be a pointer (PHPLLVM\LLVMAbstract\Module::verify)

php-src reference

PHP implementation target

  • ext/standard/ crc32 helper / NestedJIT string→int lowering (share VM path; fix pointer cast in LLVM emission)
  • Prefer PHP-in-PHP; no new runtime/*.c logic

Repro

./script/docker-exec.sh -- bash -lc '
cat > /tmp/aot_crc32.php <<'"'"'PHP'"'"'
<?php
echo crc32("php-compiler"), PHP_EOL;
PHP
echo -n "zend="; php /tmp/aot_crc32.php
echo -n "vm="; php bin/vm.php /tmp/aot_crc32.php 2>/dev/null
echo -n "jit="; php bin/jit.php /tmp/aot_crc32.php 2>/dev/null
php bin/compile.php -o /tmp/aot_crc32 /tmp/aot_crc32.php
'

Done when

  • php bin/compile.php succeeds for the repro
  • AOT binary prints 4282364586 matching Zend/VM/JIT
  • Prefer --repeat 10 on the built binary
  • test/repro/ or compliance guard
  • php-src-strict; no php-compiler-strict shortcut
  • No restamp / fake green — exercise the built binary

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITbugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions