w6c: global *struct base field store loads the pointer from g(SB)

cstage dereferenced 0(BP) for the base — a SEGV on every store
through a module-global struct pointer; wwstage was already correct
(the inverse-set member). Mirror ww's global-pointer load. New
989_globptrfield_run pins cs==ww both stages. Task #47.
This commit is contained in:
2026-06-12 22:48:37 +09:00
parent e09a8c1775
commit 77747061c6
3 changed files with 179 additions and 1 deletions

View File

@@ -264,6 +264,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_globstructret_run \
$(BIN)/test_globstructwiden_run \
$(BIN)/test_globtagwiden_run \
$(BIN)/test_globptrfield_run \
$(BIN)/test_globfloatstructarg_run \
$(BIN)/test_arr_ptr_global \
$(BIN)/test_def_arr_infer_len \
@@ -823,6 +824,17 @@ $(BIN)/test_globtagwiden_run: test/wcc/989_globtagwiden_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_globptrfield_run (inverse-set #47, report-item [58]): a field store
# through a module-global *struct pointer must load the pointer from g(SB),
# not deref saved BP. cstage SEGV'd (rc=139); align cstage UP to ww (rc=7),
# cs==ww byte-identical. Runtime-assign repro (static-init form is #48-blocked).
$(BIN)/test_globptrfield_run: test/wcc/989_globptrfield_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 $@ $<
# 989_globfloatstructarg_run (F8-c9, #31, the EXCEPTION): a module-global
# float-bearing struct passed by value must drain its float eightbytes into
# the SSE arg regs. align-UP — structfloatclass keyed off the global tnode.