Skip to content

Regression: every phpc build fails module verification since #15866 — GC bridge miscasts + helper PHP bodies dragging broken lowerings into all builds (lib/JIT/Builtin/GcCollectCyclesRuntime.php) #16010

Description

@PurHur

Category

regression · AOT build-breaking (all scripts)

Problem

Since d17f1732d (#15866, 2026-07-04 06:57) every phpc build — including examples/000-HelloWorld and an empty script — dies with Module verification failed in compileCommon. The fast gate cannot see it (no LLVM build step), so it survived several hours and ~40 merges.

Two distinct layers:

1. Four miscasts in the new GC bridges (diagnosed via PHP_COMPILER_DUMP_IR=1):

Site Bug Fix
llvmRegistryDestructInvoked trunc i1→i8 (invalid: DestTy too big) zext
llvmRegistryObjectPtr pointerCast on i64 → addrspacecast i64→i8* intToPtr
implementGcRegisterPhpBridge pointerCast(ptr→i64) ptrToInt
implementGcRegisterPhpBridge raw i32 propCount into appendObject(i64,i64) sext

2. Deeper: the helper PHP bodies land on every build path. With the four casts fixed, verification still fails inside the nested lowering of GcCollectCyclesRegistryJitHelper.php itself: phi i64/i32 clash in incdec_null_coerce, __value__writeHashtable(%__value__*, %__value__*) vs %__hashtable__* param, ret i64 vs declared i32. These are pre-existing #15642-class lowering bugs in ++/array-write shapes — #15866 put a helper exercising them into every module.

Action taken

d17f1732d reverted in the #15619 green-master sync PR (with spine/inventory resync for the deleted GcDestructAllowDelrefJitHelper.php). Re-land #15866 only when: the four casts above are applied AND the registry helper PHP avoids (or #15642 fixes) the incdec/array-write lowerings — and add an AOT hello-world build to the fast gate so build-breaking commits cannot survive again (single phpc build ≈ 3 s in Docker).

Repro (at d17f173..head before revert)

./script/docker-exec.sh -- bash -lc "./phpc build -o /tmp/h examples/000-HelloWorld/example.php"

Done when

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MOST IMPORTANTThis are the most important targetsarea:compilerCompiler / CFG / JITbugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions