diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-02-09 12:38:16 +0100 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-02-09 12:38:16 +0100 |
| commit | e25566e20b079b7eae57518768dee44fb53c8cbb (patch) | |
| tree | a686ce563f3fd3c1798e637246957090540cbe8a /compiler/rustc_codegen_cranelift/src/value_and_place.rs | |
| parent | c40919b7a75f93ed7ef040361e82c656d246d41e (diff) | |
| parent | 7d53619064ab7045c383644cb445052d2a3d46db (diff) | |
| download | rust-e25566e20b079b7eae57518768dee44fb53c8cbb.tar.gz rust-e25566e20b079b7eae57518768dee44fb53c8cbb.zip | |
Merge commit '7d53619064ab7045c383644cb445052d2a3d46db' into sync_cg_clif-2023-02-09
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/value_and_place.rs')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/value_and_place.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/value_and_place.rs b/compiler/rustc_codegen_cranelift/src/value_and_place.rs index fa06d6c3ba7..320eecaee00 100644 --- a/compiler/rustc_codegen_cranelift/src/value_and_place.rs +++ b/compiler/rustc_codegen_cranelift/src/value_and_place.rs @@ -588,10 +588,13 @@ impl<'tcx> CPlace<'tcx> { return; } CPlaceInner::VarPair(_local, var1, var2) => { - let (ptr, meta) = from.force_stack(fx); - assert!(meta.is_none()); - let (data1, data2) = - CValue(CValueInner::ByRef(ptr, None), dst_layout).load_scalar_pair(fx); + let (data1, data2) = if from.layout().ty == dst_layout.ty { + CValue(from.0, dst_layout).load_scalar_pair(fx) + } else { + let (ptr, meta) = from.force_stack(fx); + assert!(meta.is_none()); + CValue(CValueInner::ByRef(ptr, None), dst_layout).load_scalar_pair(fx) + }; let (dst_ty1, dst_ty2) = fx.clif_pair_type(self.layout().ty).unwrap(); transmute_value(fx, var1, data1, dst_ty1); transmute_value(fx, var2, data2, dst_ty2); |
