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:
@@ -6739,9 +6739,14 @@ fn cgassign(c: *cgen, n: *node) void = {
|
||||
if (lcsname.len > 0) {
|
||||
let lcsi: *structinfo = structlookup(c, lcsname);
|
||||
if (lcsi != nil) {
|
||||
// si.totsize is slot-padded (rounded to 8);
|
||||
// receive ABI needs the TYPE's natural size.
|
||||
let lcnsz: i32 = structnaturalsize(lcsi);
|
||||
// register RECV reads AX/DX/CX at 8-byte
|
||||
// granularity — size via structabisize (cstage
|
||||
// N_ASSIGN-IDENT branch sets sz = lu->size,
|
||||
// cgen.c:4704; check.c:760 SSoT). The pre-
|
||||
// #169 structnaturalsize shorts struct{i64,i32}
|
||||
// (natural 12, ABI 16) to MOVQ+MOVL where
|
||||
// cstage writes MOVQ+MOVQ.
|
||||
let lcnsz: i32 = structabisize(lcsi);
|
||||
if (n.op == tkind.TK_ASSIGN) {
|
||||
if (n.rhs != nil
|
||||
&& n.rhs.kind == nkind.N_STRUCTLIT) {
|
||||
|
||||
Reference in New Issue
Block a user