rpg_trim.zig, rpg_eval.zig: the trim of an element, and a concatenation read as a + b #745

Manually merged
binjovi-bot merged 7 commits from lc2e into trunk 2026-11-07 10:35:13 +00:00
Owner

rpg_trim.zig, rpg_eval.zig: the trim of an element, and a concatenation read as a + b

Two rules, both found with the lc2-element-calls battery (SC-ILE/EXPERIMENTS/lc2-*).

  • The trim of an element of an array. s = %trim(names(i)),
    s = %trim(rec(i).name) and n = %len(%trim(names(i))) stopped at
    control_flow / operation 15, the head of the trim loops. The trim unit named
    three sources (a field, the pointer of a parameter, a temporary). The address
    operation of the element unit (rpg_array_element.zig), with 27 K; 62 after
    it for a part at byte K, is now a fourth (Source.element). The element stays
    on the stack, and the trim operation reads it as S260(S257) or
    %SUBST(S264(S257): 5: 9). argumentUnit (a trim as the argument of a call)
    does not take an element yet.
  • A concatenation. The compiler copies each piece into a buffer and addresses
    the next piece from the result of the copy (97 16 3 16 0; 27 K; 62). The
    copy answered 0, so 62 had nothing to add to and the statement stopped at
    value_flow / stack_value / operation 62 (h-bifs-char 40, S = C + C, was one).
    A copy into a temporary now saves its piece, answers the address that it
    wrote, and the load of the whole buffer joins the pieces in order as
    a + b. A copy is a piece only when the next operations address the bytes
    after it (27 K; 62) or a saved piece ends where it starts, so the copy of a
    constant argument into a temporary keeps its own rule. A copy also reads an
    element as its source.
    Results: S265.0 = S260(S257) + 'x' (lc2-concat-arr), S265.0 = %SUBST(S264(S257): 5: 9) + 'x' (lc2-concat-ds) and S264.0 = S255 + S255
    (h-bifs-char 40); the store of a concatenation into an element
    (lc2-store-concat-*) recovers with the typed read of the buffer on the right.

Operation 75 after a concatenation

No statement of the battery, of h-bifs-char or of the dict rows stops at
type_inference / operation 75 after a concatenation. The public statements
that stop at operation 75 are the setup of a procedure call that passes an
argument by const or by reference: 29 44 96 3; 5; 75 2; 42 252 0 N after the
copy of the argument (r9r-decstr 4, dict calls2 to calls5, CALLS 7, program-*).
The CCSID calls of branch l1f-ccsid-calls are operation 99 and do not meet it.
The battery lc2-concat-forms (25 cases) asks for the concatenation with a
varying piece or target, %CHAR and %EDITC pieces, and a concatenation as a
call argument.

Still at operation 15 in the element battery

rec(i).name = %trim(s) (the element is the target), %SCAN(%TRIM(H) : C)
(dict sv4 to sv14), %CHAR of an integer element (the parked lc2b branch),
%CHECK, %REPLACE, %SCANRPL, %UPPER, and a call that takes an element by
const or by reference.

Gates

{"checks":{"net_statements":0},"census":{"statuses":{"recovered":645,"partial":0,"unresolved":0},"regressions":0,"newly_recovered":0},"golden":"golden floor 173 ceiling 0 <= dump 173/5/0","legend":"regenerated","emit":{"worse":[],"better":10,"newly_clean":21,"clean_delta":21,"base":394,"new":415},"twins":{"groups":621,"recovered":613,"regressions":[],"newly":51},"allgroups":{"regressions":[],"newly":["savf/SC-ILE/EXPERIMENTS/h-bifs-char/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-numtrim/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/l3b-ds-var/stripped/object.savf 3","savf/SC-ILE/EXPERIMENTS/l3b-subst-var/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/lr1-di-pk3/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-pk5-sub/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-pk5/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-zd4/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-num-in-ds/stripped/object.savf 3","savf/SC-ILE/EXPERIMENTS/lr1-num-pk-ds/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-num-zd-ds/stripped/object.savf 3"],"worse":[]},"full_check":{"exit":0,"seconds":873}}
## rpg_trim.zig, rpg_eval.zig: the trim of an element, and a concatenation read as a + b Two rules, both found with the `lc2-element-calls` battery (SC-ILE/EXPERIMENTS/lc2-*). - **The trim of an element of an array.** `s = %trim(names(i))`, `s = %trim(rec(i).name)` and `n = %len(%trim(names(i)))` stopped at control_flow / operation 15, the head of the trim loops. The trim unit named three sources (a field, the pointer of a parameter, a temporary). The address operation of the element unit (`rpg_array_element.zig`), with `27 K; 62` after it for a part at byte K, is now a fourth (`Source.element`). The element stays on the stack, and the trim operation reads it as `S260(S257)` or `%SUBST(S264(S257): 5: 9)`. `argumentUnit` (a trim as the argument of a call) does not take an element yet. - **A concatenation.** The compiler copies each piece into a buffer and addresses the next piece from the result of the copy (`97 16 3 16 0; 27 K; 62`). The copy answered `0`, so `62` had nothing to add to and the statement stopped at value_flow / stack_value / operation 62 (h-bifs-char 40, `S = C + C`, was one). A copy into a temporary now saves its piece, answers the address that it wrote, and the load of the whole buffer joins the pieces in order as `a + b`. A copy is a piece only when the next operations address the bytes after it (`27 K; 62`) or a saved piece ends where it starts, so the copy of a constant argument into a temporary keeps its own rule. A copy also reads an element as its source. Results: `S265.0 = S260(S257) + 'x'` (lc2-concat-arr), `S265.0 = %SUBST(S264(S257): 5: 9) + 'x'` (lc2-concat-ds) and `S264.0 = S255 + S255` (h-bifs-char 40); the store of a concatenation into an element (lc2-store-concat-*) recovers with the typed read of the buffer on the right. ## Operation 75 after a concatenation No statement of the battery, of h-bifs-char or of the dict rows stops at type_inference / operation 75 after a concatenation. The public statements that stop at operation 75 are the setup of a procedure call that passes an argument by const or by reference: `29 44 96 3; 5; 75 2; 42 252 0 N` after the copy of the argument (r9r-decstr 4, dict calls2 to calls5, CALLS 7, program-*). The CCSID calls of branch `l1f-ccsid-calls` are operation 99 and do not meet it. The battery `lc2-concat-forms` (25 cases) asks for the concatenation with a varying piece or target, `%CHAR` and `%EDITC` pieces, and a concatenation as a call argument. ## Still at operation 15 in the element battery `rec(i).name = %trim(s)` (the element is the target), `%SCAN(%TRIM(H) : C)` (dict sv4 to sv14), `%CHAR` of an integer element (the parked `lc2b` branch), `%CHECK`, `%REPLACE`, `%SCANRPL`, `%UPPER`, and a call that takes an element by const or by reference. ## Gates ``` {"checks":{"net_statements":0},"census":{"statuses":{"recovered":645,"partial":0,"unresolved":0},"regressions":0,"newly_recovered":0},"golden":"golden floor 173 ceiling 0 <= dump 173/5/0","legend":"regenerated","emit":{"worse":[],"better":10,"newly_clean":21,"clean_delta":21,"base":394,"new":415},"twins":{"groups":621,"recovered":613,"regressions":[],"newly":51},"allgroups":{"regressions":[],"newly":["savf/SC-ILE/EXPERIMENTS/h-bifs-char/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-numtrim/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/l3b-ds-var/stripped/object.savf 3","savf/SC-ILE/EXPERIMENTS/l3b-subst-var/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/lr1-di-pk3/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-pk5-sub/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-pk5/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-zd4/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-num-in-ds/stripped/object.savf 3","savf/SC-ILE/EXPERIMENTS/lr1-num-pk-ds/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-num-zd-ds/stripped/object.savf 3"],"worse":[]},"full_check":{"exit":0,"seconds":873}} ```
binjovi-bot manually merged commit d3d90d2751 into trunk 2026-11-07 10:35:13 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/sourcerer!745
No description provided.