-
Notifications
You must be signed in to change notification settings - Fork 14k
sync adding nounwind attribute with generating abort-on-panic shim #63884
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
Conversation
|
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to assume that an imported extern "Rust" { fn bar(); } does not unwind? I just expanded the comment here to describe already existing behavior.
Cc @gnzlbg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to assume that an imported extern "Rust" { fn bar(); } does not unwind?
IIRC, "Rust", "platform-intrinsic", "rust-intrinsic", and "rustcall" are actually the same ABI, and it is ok for extern declarations of those to actually unwind. One such a declaration would be the integer add intrinsic that panics on integer overflow. We also sometimes import llvm intrinsics (via #[feature(link_llvm_intrinsics(]) using the "unadjusted" ABI. I'm not sure if that one should be able to unwind as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My personal inclination is to just remove the foreign_item case here. But that decision should probably be made by someone who actually knows the surrounding code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact I had to remove that branch to make the codegen tests work as expected. Whatever that means.
src/librustc/ty/context.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had no idea what the right place would be for this method. Suggestions?
0cf0812 to
0f6bbcb
Compare
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
|
Adjusted and expanded the failing test. I tried for a long time to also adjust and expand |
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
|
Hm, incremental thinlto tests are failing and I have no idea why, |
This comment has been minimized.
This comment has been minimized.
|
@Centril I am not entirely sure why you nominated this for T-lang? This is a bugfix, solving the problem that the comments in LLVM codegen are wrong (they say we add abort-on-panic shims but we don't). #62603 seems like the more interesting one from a T-lang perspective, that one actually changed program behavior. |
ea60cf7 to
cef82c3
Compare
cef82c3 to
2214932
Compare
|
I felt like this PR did a bit too much for backporting, so I moved the soundness-fix part into a separate PR: #63909. This PR here is now based on that. Here's the relative diff. |
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Why is this nominated for beta ? AFAICT this only fixes a bug in a unstable Rust feature right ? |
|
Does it remove the |
No, it (or rather, #63909) removes the This PR here is not nominated for backport any more.
#63909 does. This PR includes that one. That is already reflected in the PR message. |
|
Marking as blocked and removing nomination; that has been moved to #63909. |
|
☔ The latest upstream changes (presumably #64264) made this pull request unmergeable. Please resolve the merge conflicts. |
Currently, the code paths for deciding whether to add an abort-on-panic shim, and whether to add the
nounwindattribute, are separate. This unifies them. As a consequence, we now add anounwindattribute to#[unwind(aborts)]functions.The logic is also changed slightly to not take the call ABI into account any more. Fixes #63883.
Based on #63909, relative diff.