|
|
@@ -1,18 +1,18 @@
|
|
|
# Session summary — SET CONST + builtin CONST folding 2026-10-18
|
|
|
|
|
|
-Branch **`resolve-check`**. Suite **230/230**; fixpoint **OK
|
|
|
-(3,840,862 bytes)**; corpus **394/612 compile-OK, 0 crashes**.
|
|
|
+Branch **`resolve-check`**. Suite **231/231**; fixpoint **OK
|
|
|
+(3,841,894 bytes)**; corpus **396/612 compile-OK, 0 crashes**.
|
|
|
|
|
|
Tags: `v3-set-constants`, `v3-const-builtin-fold`, `v3-const-conv-fold`,
|
|
|
-`v3-array-index-fwd`, `v3-proc-addr`.
|
|
|
+`v3-array-index-fwd`, `v3-proc-addr`, `v3-proc-val`.
|
|
|
|
|
|
## What this session did
|
|
|
|
|
|
Landed the two features recorded in `docs/analysis_gaps.md` §9 by the
|
|
|
previous corpus sweep — **set constants** (static masks) and **builtin
|
|
|
calls in `CONST` initialisers** — then went further on `CONST`
|
|
|
-initialisers and forward type references. Corpus **382 → 394**
|
|
|
-(+12 files, 0 crashes).
|
|
|
+initialisers, forward type references, and procedure values. Corpus
|
|
|
+**382 → 396** (+14 files, 0 crashes).
|
|
|
|
|
|
```mod
|
|
|
CONST Digits = CharSet{"0".."9"}; (* char range *)
|
|
|
@@ -90,14 +90,17 @@ bounds (`DeferArrayIdx`); `EndTypeBlock` patches their `[lo..hi]`
|
|
|
marked, so they are unaffected. Corpus **391 → 393**; suite test
|
|
|
`t_arrfwd`.
|
|
|
|
|
|
-## Procedure addresses
|
|
|
+## Procedure values
|
|
|
|
|
|
`ADR(foo)` returned `0` (Lower's `ADR` handled only vars/params), while
|
|
|
`VAL(ADDRESS, foo)` gave the code address, so `procadr` compiled but
|
|
|
failed at run time. `Lower`'s `ADR` now emits the code address for a
|
|
|
procedure (`LowerProcAddr`). The grammar's `VAL` conversion was also
|
|
|
missing procedure-value classes: added `PROC`↔`PROC`, `PROC`↔`PTR`.
|
|
|
-Corpus **393 → 394**; suite test `t_procaddr`.
|
|
|
+Then `Assignable` rejected `p := foo` (a procedure value into a `PROC`
|
|
|
+variable, mapped onto `ADDRESS`): added `PROC`↔`PTR` assignability.
|
|
|
+`procconv` now passes and runs. Corpus **393 → 396**; suite tests
|
|
|
+`t_procaddr`, `t_procval`.
|
|
|
|
|
|
## Not fixed (recorded)
|
|
|
|
|
|
@@ -107,27 +110,30 @@ Corpus **393 → 394**; suite test `t_procaddr`.
|
|
|
parses.
|
|
|
- Forward *type* references in a `CONST` conversion (`subrange4`/`7`)
|
|
|
and as a `VAR` type before its TYPE block (`subrange11`);
|
|
|
- `minmaxreal3` (SYSTEM `REAL64`); `procconv` (`p := foo`, proc value to
|
|
|
- a `PROC` var) / `procconv2` (`CONVERT`); the `imp*` qualified-import
|
|
|
- family (partly a corpus-harness transitive-`.def` gap).
|
|
|
+ `minmaxreal3` (SYSTEM `REAL64`); `procconv2` (`CONVERT`);
|
|
|
+ `tinyproc2`/`tinyproc4` (bare procedure value as a statement); the
|
|
|
+ `imp*` qualified-import family (partly a corpus-harness
|
|
|
+ transitive-`.def` gap).
|
|
|
|
|
|
## Files
|
|
|
|
|
|
`compiler/src/Lower.{def,mod}` (evaluator + `PoolSet` call + `ADR(proc)`),
|
|
|
`compiler/src/QbeGen.{def,mod}` (`PoolSet`/`FlushSets`/pool state),
|
|
|
-`compiler/src/SymTab.{def,mod}` (forward array-index deferral),
|
|
|
+`compiler/src/SymTab.{def,mod}` (forward array-index deferral;
|
|
|
+proc-value assignability),
|
|
|
`compiler/src/M2.atg` (`ConstDecl`, `Design`, `CAP`/`ABS`/`ODD` folds,
|
|
|
`VAL` conversion folds, array-index defer, proc-value conversions),
|
|
|
`compiler/tests/t_setconst.mod`, `t_bad_setconst.mod`,
|
|
|
`t_constbuiltin.mod`, `t_constreal.mod`, `t_constlong.mod`,
|
|
|
-`t_arrfwd.mod`, `t_procaddr.mod`, `compiler/run_tests.sh`.
|
|
|
+`t_arrfwd.mod`, `t_procaddr.mod`, `t_procval.mod`,
|
|
|
+`compiler/run_tests.sh`.
|
|
|
|
|
|
## Resume
|
|
|
|
|
|
```sh
|
|
|
cd .../m2compiler-V3
|
|
|
git checkout resolve-check
|
|
|
-cd compiler && ./build.sh && ./run_tests.sh # 230/230
|
|
|
+cd compiler && ./build.sh && ./run_tests.sh # 231/231
|
|
|
cd .. && TMP="$PWD/.scratch/fixpoint" ./bootstrap/fixpoint.sh
|
|
|
-M2FLAGS="" ./.scratch/corpusx.sh # 394 OK, 0 crash
|
|
|
+M2FLAGS="" ./.scratch/corpusx.sh # 396 OK, 0 crash
|
|
|
```
|