-
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 ICE: inject bitcast if types mismatch for invokes/calls/stores #37112
Conversation
r? @Aatch (rust_highfive has picked a reviewer for you, use r? to override) |
(oh I forgot a regression test; will put into followup commit.) |
So I just realized that this fix as originally written only handles the case of calls, which does fix the specific report of #36744 but does not address the other cases that @arielb1 pointed out here: #36744 (comment) I'm looking into generalizing it slightly now to deal with more of those. Ideally we would handle the following cases (I will check off the ones that the PR handles as I go):
|
While working on this PR, I realized that one flaw in this strategy is that you can not apply the LLVM |
FYI @arielb1 mentioned over IRC discussion that he would prefer a more targeted fix oriented around changes to MIR-trans. |
We should decide whether we are going to land this patch or not. my opinion is that we should put this PR in. It solves the bulk of the occurrences of this problem (see above comment), and guards against adding the bitcast when it is unneeded by first checking if the types already match. |
Sure. My patch turned out to be more complicated than it seems. @bors r+ |
📌 Commit 0562654 has been approved by |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit 0562654 has been approved by |
Fix ICE: inject bitcast if types mismatch for invokes/calls/stores Fix ICE: inject bitcast if types mismatch for invokes/calls Fix #36744
⌛ Testing commit 0562654 with merge ce31626... |
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.
r=me modulo nit
|
||
fn check_call(typ: &str, llfn: ValueRef, args: &[ValueRef]) { | ||
if cfg!(debug_assertions) { | ||
fn check_call<'b>(&self, |
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 think a comment here would be nice-- what is this Cow
that is being returned?
(Oh, I see @arielb1 already r+'d. Seems fine.) |
Accepting for beta. Low risk patch, regression. cc @rust-lang/compiler |
Fix ICE: inject bitcast if types mismatch for invokes/calls
Partial fix for #36744