Skip to content

ssa_range_prop: avoid ICE on self-loop successors#155891

Open
SixEternals wants to merge 1 commit intorust-lang:mainfrom
SixEternals:fix/ssa-range-prop-self-loop-155836
Open

ssa_range_prop: avoid ICE on self-loop successors#155891
SixEternals wants to merge 1 commit intorust-lang:mainfrom
SixEternals:fix/ssa-range-prop-self-loop-155836

Conversation

@SixEternals
Copy link
Copy Markdown

Fixes #155836.

Replace block-inequality assertions in ssa_range_prop terminator handling
with guards that skip propagation for self-loop successors.

Added regression test:
tests/ui/mir/ssa-range-prop-self-loop-155836.rs
(-C opt-level=2, check-pass).

Validation commands:

  • ./x.py check compiler/rustc_mir_transform
  • ./x.py test tests/ui/mir/ssa-range-prop-self-loop-155836.rs

  loops

Replace self-loop assumptions in ssa_range_prop terminator
  handling with guards that skip range insertion when successor is
  in the same block. Add a UI regression test for issue rust-lang#155836 to
  ensure optimized builds no longer ICE.

Fixes rust-lang#155836

Constraint: Keep propagation behavior unchanged for non-
  self-loop edges

Rejected: Keep assert_ne! and special-case only Assert arm |
  still leaves SwitchInt self-loop paths vulnerable

Confidence: high

Scope-risk: narrow

Reversibility: clean

Directive: Do not reintroduce block-inequality assertions in
  terminator propagation without proving CFG invariants after
  simplification

Tested: ./x.py check compiler/rustc_mir_transform; ./x.py
  test tests/ui/mir/ssa-range-prop-self-loop-155836.rs

Not-tested: Broader SwitchInt multi-target stress cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: ssa_range_prop.rs:168:25: assertion left != right failed on opt-level 2

1 participant