Copy byval argument to alloca if alignment is insufficient#122212
Merged
bors merged 2 commits intorust-lang:masterfrom Mar 15, 2024
Merged
Copy byval argument to alloca if alignment is insufficient#122212bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
Conversation
Collaborator
|
r? @wesleywiser rustbot has assigned @wesleywiser. Use r? to explicitly pick a reviewer |
erikdesjardins
commented
Mar 8, 2024
Comment on lines
+210
to
+211
| let align = attrs.pointee_align.unwrap_or(self.layout.align.abi); | ||
| OperandValue::Ref(val, None, align).store(bx, dst); |
Contributor
Author
There was a problem hiding this comment.
The only functional change in this file is replacing
OperandValue::Ref(val, None, self.layout.align.abi).store(bx, dst)with
let align = attrs.pointee_align.unwrap_or(self.layout.align.abi);
OperandValue::Ref(val, None, align).store(bx, dst);since the argument alignment is not always equal to the Rust ABI alignment.
Comment on lines
+376
to
+384
| if let Some(pointee_align) = attrs.pointee_align | ||
| && pointee_align < arg.layout.align.abi | ||
| { | ||
| // ...unless the argument is underaligned, then we need to copy it to | ||
| // a higher-aligned alloca. | ||
| let tmp = PlaceRef::alloca(bx, arg.layout); | ||
| bx.store_fn_arg(arg, &mut llarg_idx, tmp); | ||
| LocalRef::Place(tmp) | ||
| } else { |
Contributor
Author
There was a problem hiding this comment.
This is the only functional change in this file.
Contributor
|
Need to adjust the comment added in #122050. |
79c1cbf to
818f130
Compare
Contributor
Author
|
@nikic done |
wesleywiser
approved these changes
Mar 13, 2024
Member
|
Thank you @erikdesjardins! 🏅 @bors r+ |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 14, 2024
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#117118 ([AIX] Remove AixLinker's debuginfo() implementation) - rust-lang#121650 (change std::process to drop supplementary groups based on CAP_SETGID) - rust-lang#121764 (Make incremental sessions identity no longer depend on the crate names provided by source code) - rust-lang#122212 (Copy byval argument to alloca if alignment is insufficient) - rust-lang#122322 (coverage: Initial support for branch coverage instrumentation) - rust-lang#122373 (Fix the conflict problem between the diagnostics fixes of lint `unnecessary_qualification` and `unused_imports`) - rust-lang#122479 (Implement `Duration::as_millis_{f64,f32}`) - rust-lang#122487 (Rename `StmtKind::Local` variant into `StmtKind::Let`) - rust-lang#122498 (Update version of cc crate) - rust-lang#122503 (Make `SubdiagMessageOp` well-formed) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 15, 2024
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#117118 ([AIX] Remove AixLinker's debuginfo() implementation) - rust-lang#121650 (change std::process to drop supplementary groups based on CAP_SETGID) - rust-lang#121764 (Make incremental sessions identity no longer depend on the crate names provided by source code) - rust-lang#122212 (Copy byval argument to alloca if alignment is insufficient) - rust-lang#122322 (coverage: Initial support for branch coverage instrumentation) - rust-lang#122373 (Fix the conflict problem between the diagnostics fixes of lint `unnecessary_qualification` and `unused_imports`) - rust-lang#122479 (Implement `Duration::as_millis_{f64,f32}`) - rust-lang#122487 (Rename `StmtKind::Local` variant into `StmtKind::Let`) - rust-lang#122498 (Update version of cc crate) - rust-lang#122503 (Make `SubdiagMessageOp` well-formed) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 15, 2024
Rollup merge of rust-lang#122212 - erikdesjardins:byval-align2, r=wesleywiser Copy byval argument to alloca if alignment is insufficient Fixes rust-lang#122211 "Ignore whitespace" recommended.
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 free
to 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.
Fixes #122211
"Ignore whitespace" recommended.