← board

Re-sweep the whole C suite for remaining unsigned-semantics gaps

Why

The two fixes exposed a recurring class of defect, not a one-off:

Each was only caught because someone happened to write the repro. A systematic sweep — every C operator/conversion exercised on an unsigned value with bit 31 set, diffed vs gcc on all five targets — will surface the rest in one pass instead of one-at-a-time.

Suspected remaining gaps (verify each vs gcc, all targets)

Each is a hypothesis to confirm/refute with a minimal repro, NOT a known bug yet.

Method

  1. Author a test/cunsigned_sweep_*.c matrix (or one program with many checks -> exit-code / oracle-diff) covering the operators × {bit-31-set operand, wrap boundary, mixed width}.
  2. Compile + run each on x86-64 (gcc oracle) and i386/arm32/aarch64/riscv32 (vs x86-64 oracle / gcc). The exit-code-bitmask style of cunsigned_int_arith_b121.c localises which check fails on which target.
  3. For every divergence: trace to frontend (type tagging / missing truncation) vs backend (hardcoded signedness), fix gated so Pascal stays byte-identical, add the repro as a permanent guard, wire into make test + cross.

Acceptance

Notes

TRIAGE note (2026-06-30) — confirmed concrete gap

Probe found a real residual: C signed arithmetic right shift is wrong on x86-64 — int s = -2; (s >> 1) returns a value != -1 (should be -1, arithmetic shift). So this sweep is justified, not speculative; start here.

Resweep done (2026-07-02, pin — see bug-c-signed-arith-shift-right for the fix pin)

Fixed the confirmed gap first: [[bug-c-signed-arith-shift-right]] (v146, all 6 backends, each encoding assembler-verified). Then systematically worked through every OTHER hypothesis this ticket listed, verifying each against a real gcc oracle before concluding:

Every hypothesis beyond the one already-fixed signed-shift gap already matched gcc — no further code changes needed. All 13 checks folded into a permanent regression test, test/cunsigned_semantics_sweep_b138.c, wired into make test + all four cross suites (i386/arm32/aarch64/ riscv32), all green. Self-host unaffected (test-only addition).