-
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
Bad MIR: StorageLive on a local that was already live with opt-level=4 #107511
Comments
@RalfJung what does the |
That's the regular |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 2, 2023
Remove both StorageLive and StorageDead in CopyProp. Fixes rust-lang#107511 rust-lang#106908 removed StorageDead without the accompanying StorageLive. In loops, execution would see repeated StorageLive, without any StorageDead, which is UB. So when removing storage statements, we have to remove both StorageLive and StorageDead. ~I also added a MIR validation pass for StorageLive. It may be a bit overzealous.~
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider this code:
When running this in Miri with
-Zmir-opt-level=4 -O
, we get an error:This is a fairly recent regression (ad48c10 was good, a322848 is bad; commit range: ad48c10...a322848).
Cc @rust-lang/wg-mir-opt
The text was updated successfully, but these errors were encountered: