rpg_subroutines.zig: a subroutine that holds a FOR loop is a valid routine (EXSR of it recovers) #761
Loading…
Reference in a new issue
No description provided.
Delete branch "lcf2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
rpg_subroutines.zig: a subroutine that holds a FOR loop is a valid routine (EXSR of it recovers)
Predicted mechanism (before the rule). The address-push arm of
rpg_eval.step(operation 33) declines asymbol that is not data: a label pointer (kind 22, a return point). That is the second site of the arm, and it
is a fallback label in every public twin that reaches it. The return point is stored by a typed construct that
a recognizer owns, and when the recognizer refuses, the evaluator reports the first operation it cannot read:
OPS/dspf-iostatement 20 (exsr load):33 505; 35 256; 18 315; 15 352 2is the EXSR call(
rpg_subroutines.Proof.callBody). The call is valid only when its routine is valid, andloadwas refusedby
validRegion: itsfor i = 1 to 3counts through a local call (33 512; 35 305; 15 383 2; 34 255 0; 35 306; 27 305; 19; 15 384 2), andvalidRegionrejects every19that is not the routine's own return or aknown I/O call, and every return point that enters the region. So the EXSR, the BEGSR marker and the ENDSR
of the routine all fell back to raw operations, and the first one reported was operation 33.
ACCESS(33 436; 35 299in the init of a linear-main module) andDSPLY/errorstatement 1100(
33 560; 37 46 64 9indsply(e)) store a return point of a compiler construct that no recognizer reads(the init template of a linear main; the (E) form of the DSPLY proof). Unchanged here; not control flow.
gap), and the held-out side cannot be told from the tokens alone.
Rule (
rpg_subroutines.inProvedFor): invalidRegion, an operation19and a typed return point whose targetlie in the head or the end statement of a FOR loop that
rpg_loops.recoverproves completely are part of thatproof and are accepted. The loop proof already checks every edge and return point of the loop.
Result: dspf-io statements 20, 34 (BEGSR) and 43 (ENDSR) recover and the routine renders
BEGSR SR315 ... ENDSR;the remaining stop of the twin is operation 15 of
%CHAR(i)(statement 37). Test:src/rpg_qual_cond_test.zig(red on trunk435ab27f, green here).lcf-qc-* twins (no-regression set)
Twenty of the 24 captured twins are adopted (
lcfqc-*; the four that need the empty-IF rule of #758 or a datecompare are left out). On the Debug build of #758 none of the 24 stops at control_flow. Without #758 only
empty-c3andempty-plaindo (condition_boundary), which names the empty body, not the subfield, as thecause. The other stops are outside control flow: packed and zoned compared with a literal
(type_inference / decimal_positions:
if-p0,if-p3,if-z0,if-z3,and-cz,or-cp,nested) and adate subfield compared with a date field (
if-d0,if-d3: call / classification).