-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #56300 - nikic:issue-56267, r=eddyb
Fix alignment of stores to scalar pair The alignment for the second element of a scalar pair is not the same as for the first element, make sure it is calculated correctly. This fixes #56267. r? @eddyb
- Loading branch information
Showing
2 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// compile-flags: -C no-prepopulate-passes | ||
|
||
#![crate_type="rlib"] | ||
|
||
#[allow(dead_code)] | ||
pub struct Foo<T> { | ||
foo: u64, | ||
bar: T, | ||
} | ||
|
||
// The store writing to bar.1 should have alignment 4. Not checking | ||
// other stores here, as the alignment will be platform-dependent. | ||
|
||
// CHECK: store i32 [[TMP1:%.+]], i32* [[TMP2:%.+]], align 4 | ||
#[no_mangle] | ||
pub fn test(x: (i32, i32)) -> Foo<(i32, i32)> { | ||
Foo { foo: 0, bar: x } | ||
} |