mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-07 04:38:46 +00:00
rustc_trans: work around i686-pc-windows-msvc byval align LLVM bug.
This commit is contained in:
parent
b0812de556
commit
88e4d2c291
@ -491,7 +491,9 @@ impl<'a, 'tcx> ArgType<'tcx> {
|
|||||||
.set(ArgAttribute::NoCapture)
|
.set(ArgAttribute::NoCapture)
|
||||||
.set(ArgAttribute::NonNull);
|
.set(ArgAttribute::NonNull);
|
||||||
attrs.pointee_size = self.layout.size;
|
attrs.pointee_size = self.layout.size;
|
||||||
attrs.pointee_align = Some(self.layout.align);
|
// FIXME(eddyb) We should be doing this, but at least on
|
||||||
|
// i686-pc-windows-msvc, it results in wrong stack offsets.
|
||||||
|
// attrs.pointee_align = Some(self.layout.align);
|
||||||
|
|
||||||
self.mode = PassMode::Indirect(attrs);
|
self.mode = PassMode::Indirect(attrs);
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ pub fn mutable_unsafe_borrow(_: &mut UnsafeInner) {
|
|||||||
pub fn mutable_borrow(_: &mut i32) {
|
pub fn mutable_borrow(_: &mut i32) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// CHECK: @indirect_struct(%S* noalias nocapture align 4 dereferenceable(32) %arg0)
|
// CHECK: @indirect_struct(%S* noalias nocapture dereferenceable(32) %arg0)
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub fn indirect_struct(_: S) {
|
pub fn indirect_struct(_: S) {
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ pub fn _box(x: Box<i32>) -> Box<i32> {
|
|||||||
x
|
x
|
||||||
}
|
}
|
||||||
|
|
||||||
// CHECK: @struct_return(%S* noalias nocapture sret align 4 dereferenceable(32))
|
// CHECK: @struct_return(%S* noalias nocapture sret dereferenceable(32))
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub fn struct_return() -> S {
|
pub fn struct_return() -> S {
|
||||||
S {
|
S {
|
||||||
|
@ -39,7 +39,7 @@ pub struct BigPacked {
|
|||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub fn call_pkd(f: fn() -> Array) -> BigPacked {
|
pub fn call_pkd(f: fn() -> Array) -> BigPacked {
|
||||||
// CHECK: [[ALLOCA:%[_a-z0-9]+]] = alloca %Array
|
// CHECK: [[ALLOCA:%[_a-z0-9]+]] = alloca %Array
|
||||||
// CHECK: call void %{{.*}}(%Array* noalias nocapture sret align 4 dereferenceable(32) [[ALLOCA]])
|
// CHECK: call void %{{.*}}(%Array* noalias nocapture sret dereferenceable(32) [[ALLOCA]])
|
||||||
// CHECK: call void @llvm.memcpy.{{.*}}(i8* %{{.*}}, i8* %{{.*}}, i{{[0-9]+}} 32, i32 1, i1 false)
|
// CHECK: call void @llvm.memcpy.{{.*}}(i8* %{{.*}}, i8* %{{.*}}, i{{[0-9]+}} 32, i32 1, i1 false)
|
||||||
// check that calls whose destination is a field of a packed struct
|
// check that calls whose destination is a field of a packed struct
|
||||||
// go through an alloca rather than calling the function with an
|
// go through an alloca rather than calling the function with an
|
||||||
|
Loading…
Reference in New Issue
Block a user