brintos

brintos / hwjs-cc public Read only

0
0

coroutinize/fpcast: ~450 indirect-call sites refused on clang OpenMP/atomic codegen (fpcast-{missing-arg,used-void-return,sret,param-coerce}) — raw call_indirect that traps if executed #14

Open sasha opened this issue · 0 comments
S sasha commented

Summary

The coroutinize/fpcast adapter pass REFUSES ~450 indirect-call sites in the self-hosted clang link, leaving a raw strict call_indirect at each — which will TRAP if that site is ever executed. The refusals come from clang's OpenMP / atomic indirect-call codegen (function-pointer tables whose signatures don't exactly match the call site). We filtered these refusals out of the pass marker replay to get a linkable binary (otherwise the link fatals); the resulting clang.wasm works for ordinary compilation but would trap if it ever reaches one of these sites at runtime (OpenMP/atomic paths).

Refusal reasons observed (~450 sites)

  • fpcast-missing-arg — caller passes fewer args than the callee's signature
  • fpcast-used-void-return — void-returning callee whose result is used (or vice versa)
  • fpcast-sret — struct-return hidden-pointer mismatch
  • fpcast-param-coerce — a parameter needs a coercion the pass can't synthesize

Reproduce (no artifact needed)

Coroutinize clang (or any program whose codegen emits OpenMP/atomic indirect calls through mismatched-signature function-pointer tables) and grep the pass markers for the fpcast-* REFUSE reasons — the refusals are emitted by the pass itself.

Note / relation

Distinct instance from the existing fpcast issues (#4 phase-order, closed; #10 invoke-form callee-suspend, open). Latent / lower-priority — basic compilation does not appear to hit these sites — but reporting for completeness. The pass should either synthesize adapters for these mismatch shapes, or surface them as a hard link-time error rather than a silent raw call that traps at runtime.

Proposed fix targets brintos/hwjs-cc only — no distro submodule pins moved. All distros share one lineage, so pin bumps are coordinated on merge, not per-engineer.