wcc/ww: is/as on a module-global tagged ident loads from g(SB)

The global tagged ident operand read saved BP instead of the global:
'is' compared garbage as the tag; 'as' never had a payload. Route the
load through the g(SB) base — tag at +0, payload at +8, cap at +16 for
str (one mechanism, both consumers). The 'is' half aligns ww UP
(cs==ww pinned); the 'as' half is a both-wrong pair — cstage spills an
uninitialized payload register (its N_TYPEASSERT assumes cgexpr filled
AX/DX/CX; filed as task #46), so its rows assert ww-runtime-correct
with the cs divergence documented until #46 lands. Review item #18.
This commit is contained in:
2026-06-12 09:03:40 +09:00
parent 1eceb46ac3
commit 4961a91d14
5 changed files with 311 additions and 9 deletions

View File

@@ -257,6 +257,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_tagnorm_run \
$(BIN)/test_globslicefield_run \
$(BIN)/test_globstrslice_run \
$(BIN)/test_globtagisas_run \
$(BIN)/test_arr_ptr_global \
$(BIN)/test_def_arr_infer_len \
$(BIN)/test_def_arr_len \
@@ -735,6 +736,17 @@ $(BIN)/test_globstrslice_run: test/wcc/989_globstrslice_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_globtagisas_run (F8-c3, #18): `is`/`as` on a module-global tagged
# ident must read tag/payload from g(SB), not saved-BP. MIXED per-half:
# `is` align-UP (cs==ww); `as` #263 ww-runtime-correct (cs!=ww residual,
# cstage half = task #46). Per-driver expected rows. See the test header.
$(BIN)/test_globtagisas_run: test/wcc/989_globtagisas_run.c \
$(BIN)/ww $(BIN)/ww_ww \
$(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \
$(BIN)/w6c_ww $(BIN)/w6a_ww $(BIN)/w6l_ww \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
$(BIN)/test_let_global: test/wcc/630_let_global.c $(BIN)/ww $(BIN)/w6c \
$(BIN)/w6a $(BIN)/w6l $(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<