Tag v3-selfcompiles. Main suite 111/111.
The self-compiled V3 (/tmp/M2self, built by V3 from its own
sources) now runs, parses, and emits code. For a test file its output
is byte-identical to the gm2-built V3's:
./M2 tests/t_constfold.mod -> gen_ssa/TConstFold.ssa
/tmp/M2self tests/t_constfold.mod -> gen_ssa/TConstFold.ssa
cmp: *** IDENTICAL ***
That is a stage-2 self-hosting fixpoint for t_constfold.
OR/AND NIL dereferences — gm2 short-circuits, V3 does
not. Rewrote SymTab's guard sites ((x = NIL) OR (x^.…)) into
sequential checks, and the driver's PrintListing loop
((nextErr # NIL) AND (nextErr^.line = …)) into a done flag.QbeGen's Len/Cpy/App/ParseInt
looped with i < HIGH(s); for a string literal HIGH = len-1, so
the last character was dropped. App(fname, "gen_ssa/") produced
"gen_ssa", mangling the output file name. Changed to <= HIGH(s)./tmp/M2self over the
full set).FileIO selection and bootstrap/fixpoint.sh
(Stage1 gm2 → Stage2 V3 → Stage3 V3, byte-identical .ssa), with the
stage-aware CR flag.compiler/src/{SymTab.mod,compiler.frm,QbeGen.mod,M2.lst}.