Repository navigation
Conversation
`o.cfg.n = v` with cfg: ptr<Inner> is C's o->cfg->n = v. mlirgen's struct-address walk gave up on a ptr<S> field, and the assignment then took the Python fallback that drops the store and leaves a comment. The program kept running with the old value: tests/lang/test_store_after_call and tests/cgen/store_after_call exited 3 and test_import_field_chain 2, where C exits 0. The walk now loads the field's pointer and continues in the pointee struct. compiler/fixtures/mlir/field_store_ptr.flow stores through one and two pointer fields; the old backend printed 1 2 3 and exited 1. Corpus digests moved for the programs that make such a store.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: godofecht <[email protected]>
|
Resolved current-main merge conflict in |
|
CI repair triage on current head |
|
Superseded by merged #1666, which explicitly migrates this pointer-field MLIR store fix onto current main, preserving backend source and fixture while regenerating bootstrap and affected corpus digests. #1666 passed full compiler CI and Linux/macOS qualification before merging. Closing this historical PR to avoid duplicate integration; its branch and history remain available. |
Pull request was closed
Cause
o.cfg.n = vwithcfg: ptr<Inner>is C'so->cfg->n = v. mlirgen's struct-address walk (mlg_struct_addr0) gave up on a field of typeptr<S>. The assignment then took the fallback inherited from the Python generator, which drops the store and leaves the comment// Unsupported assignment target expression. The program kept running with the old value, with no diagnostic.Corpus programs that hit it:
tests/lang/test_store_after_call.flowandtests/cgen/store_after_call.flow(exit 3 under MLIR, 0 under C) andtests/lang/test_import_field_chain.flow(2 against 0).Fix
When the field is
ptr<S>for a known struct S, the walk loads the field's pointer and continues in S. Reads already handled pointer fields; stores now match them.Regression test
compiler/fixtures/mlir/field_store_ptr.flowstores through one and two pointer fields. The old backend printed1 2 3and exited 1; the recorded run is9 42 5, exit 0, as C prints.Counts (mlir_vs_c, full corpus, --jobs 8, macOS arm64, LLVM 22.1.7)
Now same: the two store_after_call tests, test_import_field_chain, and the new fixture.
tests/cgen/for_variable_step.flow(c-fail-mlir) is also same in this run, which is build timing.examples/concurrency/work_steal.flowandtests/lang/test_c_import_string_time.flowwent from same to nondet (scheduler and clock output, also seen on the other branches). No program that was same now fails.Gates
bootstrap_from_c.sh --regen, then--verify: PASSmlir_math_override, in its C backend half. It fails the same way with a flowc built from main's bootstrap C.Regenerated state
compiler/bootstrap/flowc_stage_a.candflowc_stage_a, in their own last commit.field_store_ptr.mlirand.out.compiler/fixtures/mlir/corpus.txt: 6 digests move, for the programs whose MLIR now has the store (the two store_after_call tests,lib/stdlib/gpu_graph_reference.flowand the three programs that import it). The 11 programs main never recorded are left out.The floor in
compiler/mlir_vs_c/floor.txtis not changed.Risk
Low. Only stores that were silently dropped change.
lib/stdlib/gpu_graph_reference.flowwas among them, so programs using it under MLIR now keep those writes.