Repository navigation
codegen: a bundle global whose initializer did not fold is refused where a body reads it, never a zeroed stand-in (#2219) - #2226
Merged
Conversation
…ere a body reads it, never a zeroed stand-in (#2219) A bundle-owned global whose initializer `try_eval_const_llvm` could not fold has no storage in the object (D38 Level 0 omits it) and no initializer ever runs for it. A body that read it got a fresh local alloca from `mir_place_ptr` (`create_base`) — a zeroed local standing in for the global — and the build exited 0: a consumer calling `limit_x()` over `pub let LIMITS = Point { x: side(), y: 0 }` printed 0. Now `mir_bind_global_locals` refuses the body naming the global, the body and the sub-expression the fold stopped at (`try_eval_const_llvm` records the innermost failing node in `const_fold_unfolded_node`; `gen_module_constant` keeps it per global in `unlowered_global_reasons`), and `mir_place_ptr` never invents storage for a global local. A global nothing reads is omitted as before. Fixtures: `wi_refuse_global_init` (refused, no interface written; fails on the pre-fix compiler with "expected --emit-bundle-interface to refuse") and `wi_omit_global_init` (omitted with the note and manifest line), in bundle-interface-tests.
Contributor
Author
|
Battery GREEN on stack top bfecc6f (seed-driven, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A bundle-owned global whose initializer does not fold to data has no storage in the object and no initializer runs for it; a body reading it got a fresh zeroed alloca from
mir_place_ptrand the build exited 0 (a consumer read 0). Nowmir_bind_global_localsrefuses the body naming the global, the body and the sub-expression the fold stopped at, andmir_place_ptrnever invents storage for a global. An unread global stays omitted. Fixtureswi_refuse_global_init/wi_omit_global_initin bundle-interface-tests.Fixes #2219. Draft until the stack's battery is green.