-
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
Fix MIR inlining of asm_unwind #102778
Fix MIR inlining of asm_unwind #102778
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
Thanks! |
@bors r+ |
@bors delegate=nbdd0121 |
✌️ @nbdd0121 can now approve this pull request |
@bors r=tmiasko |
📌 Commit 18a1de0836cb5ceae21b0578bfba029404617c97 has been approved by It is now in the queue for this repository. |
This comment has been minimized.
This comment has been minimized.
@bors r=tmiasko |
I believe |
That's correct. |
Great, thank you! 🙂 |
Fix MIR inlining of asm_unwind The MIR inlining currently doesn't handle inline asm's unwind edge correctly. This code will cause ICE: ```rust struct D; impl Drop for D { fn drop(&mut self) {} } #[inline(always)] fn foo() { let _d = D; unsafe { std::arch::asm!("", options(may_unwind)) }; } pub fn main() { foo(); } ``` This PR fixes this issue. I also take the opportunity to extract common code into a method.
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#101520 (Allow transmutes between the same types after erasing lifetimes) - rust-lang#102675 (Remove `mir::CastKind::Misc`) - rust-lang#102778 (Fix MIR inlining of asm_unwind) - rust-lang#102785 (Remove `DefId` from some `SelectionCandidate` variants) - rust-lang#102788 (Update rustc-dev-guide) - rust-lang#102789 (Update browser UI test version) - rust-lang#102797 (rustdoc: remove no-op CSS `.rightside { position: initial }`) - rust-lang#102798 (rustdoc: add main-heading and example-wrap link CSS to big selector) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
The MIR inlining currently doesn't handle inline asm's unwind edge correctly.
This code will cause ICE:
This PR fixes this issue. I also take the opportunity to extract common code into a method.