Uh oh!
There was an error while loading. Please reload this page.
MIR: hide .rodata constants vs by-ref ABI clash in trans. - #45996
Merged
Conversation
dotdash
commented
Nov 15, 2017
Contributor
LGTM, I'll let @arielb1 have a look first though |
kennytm
commented
Nov 15, 2017
Member
r? @arielb1 |
arielb1
commented
Nov 15, 2017
Contributor
@bors r+ |
bors
commented
Nov 15, 2017
Collaborator
📌 Commit 0baeae4 has been approved by |
eddyb
commented
Nov 16, 2017
ContributorAuthor
@bors r=arielb1 |
bors
commented
Nov 16, 2017
Collaborator
📌 Commit bacb3ca has been approved by |
bors
commented
Nov 16, 2017
Collaborator
☔ The latest upstream changes (presumably #45825) made this pull request unmergeable. Please resolve the merge conflicts. |
eddyb
commented
Nov 16, 2017
ContributorAuthor
@bors r=arielb1 |
bors
commented
Nov 16, 2017
Collaborator
📌 Commit 6db6893 has been approved by |
bors
commented
Nov 17, 2017
Collaborator
bors added a commit
that referenced
this pull request
Nov 17, 2017
MIR: hide .rodata constants vs by-ref ABI clash in trans. Back in #45380, constants were copied into locals during MIR creation to ensure that arguments ' memory can be used by the callee, if the constant is placed in `.rodata` and the ABI passes it by-ref. However, there are several drawbacks (see #45380 (comment)), most importantly the complication of constant propagation (UB if a constant ends up in `Call` arguments) and inconveniencing analyses. Instead, I've modified the `rustc_trans` implementation of calls to copy an `Operand::Constant` argument locally if it's not immediate, and added a test that segfaults without the copy. cc @dotdash@arielb1
bors
commented
Nov 17, 2017
Collaborator
☀️ Test successful - status-appveyor, status-travis |
This was referenced Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Back in #45380, constants were copied into locals during MIR creation to ensure that arguments ' memory can be used by the callee, if the constant is placed in
.rodataand the ABI passes it by-ref.However, there are several drawbacks (see #45380 (comment)), most importantly the complication of constant propagation (UB if a constant ends up in
Callarguments) and inconveniencing analyses.Instead, I've modified the
rustc_transimplementation of calls to copy anOperand::Constantargument locally if it's not immediate, and added a test that segfaults without the copy.cc @dotdash@arielb1