wwstage: name vararg-gather slots via mklabel; graduate fmt 777/780/781 (#227)

wwstage named variadic-gather slots with mkvarargname off a separate
varargseq counter, never bumping the shared labelseq that names match
labels. cstage names them via mklabel (cmd/w6c/cgen.c:5427,5431), which
advances labelseq twice per gather. So by the time main.main reached its
`match (wr)`, wwstage's match-label counter ran two behind cstage's
(_4/_5/_6 vs _6/_7/_8) — a pure label-numbering divergence that kept fmt
cs/ww byte-id failing.

Drop varargseq and the mkvarargname helper; call the existing mklabel
for the two gather slots, matching cstage's order (vararg_d only when
nvar>0, vararg_sl always). The slot names are locals-table keys only —
they resolve to BP offsets and never reach the asm — so only the
labelseq advance is observable, which is exactly what realigns the
downstream match labels. cstage untouched (align wwstage up).

This was the match-label half of fmt's divergence; with the earlier
compound-assign fix it completes fmt byte-identity. Graduate
777/780/781 to STAGE_CS|STAGE_WW with byte_id, and drop the now-stale
(void)asm_byte_identical guard in 777.
This commit is contained in:
2026-06-01 05:04:46 +09:00
parent 9cf1560392
commit 954badd28f
8 changed files with 58 additions and 152 deletions

View File

@@ -125,7 +125,7 @@ static const struct row rows[] = {
" return 60;\n"
"};\n",
60,
STAGE_CS, 0 },
STAGE_CS | STAGE_WW, 1 },
{ "fprintfln_file_fmt",
"package main;\n"
"import os;\n"
@@ -153,7 +153,7 @@ static const struct row rows[] = {
" return 61;\n"
"};\n",
61,
STAGE_CS, 0 },
STAGE_CS | STAGE_WW, 1 },
{ "fprintln_basic",
"package main;\n"
"import os;\n"
@@ -180,7 +180,7 @@ static const struct row rows[] = {
" return 64;\n"
"};\n",
64,
STAGE_CS, 0 },
STAGE_CS | STAGE_WW, 1 },
{ "fprintfln_basic",
"package main;\n"
"import os;\n"
@@ -205,7 +205,7 @@ static const struct row rows[] = {
" return 65;\n"
"};\n",
65,
STAGE_CS, 0 },
STAGE_CS | STAGE_WW, 1 },
{ "bsprintf_basic",
"package main;\n"
"import os;\n"
@@ -226,7 +226,7 @@ static const struct row rows[] = {
" return 62;\n"
"};\n",
62,
STAGE_CS, 0 },
STAGE_CS | STAGE_WW, 1 },
{ "asprintf_basic",
"package main;\n"
"import os;\n"
@@ -242,7 +242,7 @@ static const struct row rows[] = {
" return 63;\n"
"};\n",
63,
STAGE_CS, 0 },
STAGE_CS | STAGE_WW, 1 },
};
static int