wcc: converge let-IDENT memcpy, IDENT-assign recv, nested struct call-recv onto structabisize

Three more wwstage cgen sites still used unrounded structnaturalsize where
cstage rounds via lu->size — pre-existing gate-blind cs!=ww latents the #169b
reviewer surfaced: cgenstmt N_LET struct-IDENT memcpy (let p2: T = p1; twin
cgen.c:7869), cgenexpr N_ASSIGN N_IDENT-lhs register RECV (s = mk(); twin
cgen.c:4700-4737), and cgenutil's nested struct N_CALL recv inside
cgstructlitfill (twin cgen.c:2121).

Converge all three onto structabisize, completing the same-class closure
started by #169 and continued by #169b. Also corrected the inline comment at
cgenutil.ww:3273-3286 that wrongly claimed fl->type->size was natural
(check.c:760 sets ABI). sretretsize at cgenutil.ww:1301 is gate-equivalent
natural and is left alone.

Probe 698 +3 rows (one per converged site) with cs==ww .s byte-cmp and a
pre-fix-rebuild discriminator. 990-997 byte-id hold.
This commit is contained in:
2026-05-28 14:07:58 +09:00
parent 39f9267bc9
commit 66a91c8969
6 changed files with 142 additions and 60 deletions

View File

@@ -3270,21 +3270,22 @@ fn cgstructlitfill(c: *cgen, si: *structinfo, lit: *node,
if (primsize(fi.tnode.str) == 0) {
let csi: *structinfo = structlookup(c, fi.tnode.str);
if (csi != nil) {
// Use the inner struct's
// NATURAL size (no 8B slot
// rounding) so MOVL/MOVW/
// MOVB tail dispatch matches
// cstage's fl->type->size
// (which is natural per
// check.c). fi.fsz here is
// Inner struct's ABI size
// (maxalign-rounded) — cstage
// reads fl->type->size at the
// nested-call branch
// (cgen.c:2121); check.c:760
// sets that to the
// maxalign-rounded ABI extent
// (NOT natural). fi.fsz is
// wwstage's slot-padded
// totsize — using it would
// emit 2× MOVQ where cstage
// emits MOVQ+MOVL for a
// 12B inner, etc. (task #15
// territory; sidestepped
// locally.)
let cfsz: i32 = structnaturalsize(csi);
// totsize (round-to-8); the
// pre-#169 structnaturalsize
// shorts struct{i64,i32}
// (natural 12, ABI 16) to
// MOVQ+MOVL where cstage
// writes MOVQ+MOVQ.
let cfsz: i32 = structabisize(csi);
let crem: i32 = cfsz - (cfsz / 8) * 8;
if (cfsz <= 24) {
if (crem == 0 || crem == 1