GVN misunderstands aliasing, can create overlapping assignments (again) #141313
Labels
A-mir-opt
Area: MIR optimizations
A-mir-opt-GVN
Area: MIR opt Global Value Numbering (GVN)
A-rustlantis
A miscompilation found by Rustlantis
C-bug
Category: This is a bug.
I-miscompile
Issue: Correct Rust code lowers to incorrect machine code
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
P-medium
Medium priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
This looks very similar to #141038, but the compiler that found this has the patch that was linked to that issue.
Reduced example from rustlantis, which is accepted by Miri without optimizations enabled:
If I run this under Miri with
-Zmir-enable-passes=+GVN
, I see:The MIR diff for GVN is:
The text was updated successfully, but these errors were encountered: