← board

gcc c-torture: one-time miscompile harvest (permanent runner dropped)

Downscope decision (user, 2026-07-15)

The original ticket proposed a permanent run_c_torture.sh + a ratcheting pxx.skip file + Makefile target + tier placement. Dropped. The baseline already showed ~700 of 783 failures are GNU-extension / non-ISO-C dialect gaps (nested functions, _Complex, VLA, vectors, computed goto, __builtin_*) — things pxx may never implement — so seeding and maintaining a 700-line skip-file ratchet is busywork. csmith already covers random C differential; c-testsuite covers conformance. A third standing C corpus with a maintenance tail is not worth it while the C frontend is mature (tcc self-compiles; sqlite/lua/zlib pass).

The one real asset is the ~50-80 runtime failures (compile silently, then abort/segv/timeout) — a pre-triaged, gcc-blessed, self-checking miscompile queue. That value is captured by a one-time harvest, not a runner: run the execute suite once, triage the runtime fails into owning-lane tickets, discard the dialect skips. No skip-file, no tier, no maintenance.

Corpus (already vendored)

library_candidates/gcc-torture/execute/ — 1656 self-checking single-file C programs (each abort()s on a wrong result, exits 0 on success; oracle-free). GPL test DATA only, gitignored, never linked/shipped. Left in place by the reverted Track A draft.

Harvest tool: tools/c_torture_harvest.sh (one-shot, NOT gated)

bash tools/c_torture_harvest.sh [outdir]. Compiles each program with pxx -Ilib/crtl/include -Ilib/crtl/src; a COMPILE failure is a dialect gap (skip); a compile HANG or nonzero RUN exit is a candidate. Candidates are cross-checked against gcc and bucketed into pxx_only.txt (gcc passes → real pxx bug), both_fail.txt (gcc also fails even with -O2 -lm → INVESTIGATE, never dropped), and feature_gap.txt (program declares a dg-options flag pxx lacks). The gcc check retries -O2 and -lm before believing gcc fails — that recovers real bugs a naive gcc <f> would hide (see the float-floor case below). NOT a runner, NOT wired into any tier — a manual discovery tool.

Results (2026-07-15 harvest, opus-trackT)

scratchpad/torture_harvest.sh over all 1656 execute programs (pxx -Ilib/crtl/include -Ilib/crtl/src, 25s compile / 15s run timeouts):

Methodology note — do NOT auto-dismiss "gcc also fails" (user, 2026-07-15)

The gcc oracle is a cross-check, not ground truth, and a "gcc also fails" result is more intriguing, not a reason to drop:

  1. the failure may be a harness artifact hiding a real pxx bug (float-floor: missing -lm at -O0) — always retry with -O2 and -lm before concluding gcc fails;
  2. both compilers may mishandle a well-defined program differently (a real pxx bug gcc happens to share, or a genuine gcc bug);
  3. only a documented feature requirement the program itself declares (a dg-options flag pxx doesn't implement, like -finstrument-functions) is a legitimate drop. Same principle pasmith already applies to its FPC oracle: earn the dismissal, never reflex it. A "both fail" case is a THIRD bucket to investigate, never a silent discard.

74 gcc-verified pxx-only miscompiles, clustered by construct (the standing triage queue — reproduce any with compiler/pascal26 -Ilib/crtl/include -Ilib/crtl/src library_candidates/gcc-torture/execute/<f> /tmp/x && /tmp/x):

Two compiler HANGS (worst class — non-termination on valid input): pr23324.c (in the bitfield ticket) and one more surfaced under the compile timeout — grep compile-hang in the run.

Decision on the remaining families: recorded here as the triage queue rather than filed as ~8 thin cluster stubs (per the "limit ticket noise" guidance). The bitfield cluster is the worked exemplar; an owning-lane agent pulls the next family from this list and files/fixes it the same way. Bump this ticket's prio if that should happen proactively.

Acceptance (downscoped)

Log