-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InstCombine
can incorrectly deinitialize locals that are later used
#72797
Labels
A-mir-opt
Area: MIR optimizations
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
jonas-schievink
added
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
C-bug
Category: This is a bug.
A-mir-opt
Area: MIR optimizations
labels
May 30, 2020
Maybe we should stop making instcombine convert Alternatively instcombine needs to start using dataflow to only insert moves when the site is the last use of the local. |
petrochenkov
added a commit
to petrochenkov/rust
that referenced
this issue
Dec 20, 2023
to pick up "[M68k] Fix ODR violation in GISel code (rust-lang#72797)" rust-lang/llvm-project#159
petrochenkov
added a commit
to petrochenkov/rust
that referenced
this issue
Dec 20, 2023
to pick up "[M68k] Fix ODR violation in GISel code (rust-lang#72797)" rust-lang/llvm-project#159
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Dec 20, 2023
Update LLVM submodule to pick up "[M68k] Fix ODR violation in GISel code (rust-lang#72797)" rust-lang/llvm-project#159. Fixes rust-lang#107668
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Dec 20, 2023
Rollup merge of rust-lang#119159 - petrochenkov:llvmup, r=nikic Update LLVM submodule to pick up "[M68k] Fix ODR violation in GISel code (rust-lang#72797)" rust-lang/llvm-project#159. Fixes rust-lang#107668
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-mir-opt
Area: MIR optimizations
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Since #72093 InstCombine can now introduce
Operand::Move
where there was none before, without checking that the value is in fact not used afterwards. This may cause a value to be marked as uninitialized by theMaybeInitializedLocals
dataflow, but still be used in that uninitialized state.If InstCombine ran before the generator transform this would be acutely unsound and could probably be exploited directly, but other than that transform I don't think we rely on this property yet.
This impacts #72632, which does run after InstCombine and relies on the
MaybeInitializedLocals
dataflow.I've observed this on
BinaryHeap::peek_mut
, where it produces this diff:The second use of
_1
occurs despite the first move deinitializing the local.cc @rust-lang/wg-mir-opt
The text was updated successfully, but these errors were encountered: