1175711021170937e46f3ca76ba0933cff3ff419
Assigning a >24B by-value struct-return into a GLOBAL lvalue dropped the struct body: the sret dest was routed to a BP scratch temp and only the 8-byte return pointer was stored (`MOVQ AX, g(SB)`); the callee wrote the full struct to the scratch, which never reached the global. A BP-relative dest offset cannot name a global symbol. Pre-existing GATE-BLIND silent miscompile — both stages emit the same broken store, so byte-id (990-997) stays green while runtime is wrong — latent until the eFinal io surface put a global `cgoutstream: memio.stream` (>24B) on the path, where it made cgen.ww's self-built w6c_ww buffer every function body into a corrupt global (pos stayed 0) and emit prologue-only output. Fix, both stages, byte-identical: route the sret dest pointer to the global symbol so the callee writes the full struct through RDI straight into the global. cstage adds cg_sret_dest_sym, mirroring the existing str/slice global arm (skip the @sretscr scratch, emit `LEAQ masym(sym), DI`). wwstage carries the lhs IDENT node (sretdestnode) and emits `LEAQ name(SB), DI` via emitsymname — identical to cstage's symbol mangling, verified cs.s==ww.s on the probe and across 990-997. #211-family (by-value struct + global/pointer), but a distinct site: the cstage assignment-store into a global, not the wwstage call-return. N_LET-global static-init (`let g: T = mk()` at top level) is a separate, independently-broken path (#221) — link-fails for init-via-call, returns 0 for constant init — not the sret-receive gap and not on the eFinal path; deferred. test/wcc/940_global_sret_run: global assign (plus a branched callee to defeat const-fold), through-pointer mutation (the io vtable-callback shape that surfaced this), and local-init/assign regressions — runtime asserts on both stages (the net, since byte-id is gate-blind here) plus cs.s==ww.s. Discrimination confirmed by revert+rebuild: with the global arm disabled, global_assign emits the truncated store and exits 1.
Description
No description provided
Languages
C
89.4%
Python
7.2%
Makefile
2.3%
Shell
0.8%
Assembly
0.3%