Merge pull request #2843 from uweigand/spillslot-fix
cranelift: Fix spillslot regression on big-endian platforms
This commit is contained in:
@@ -1209,6 +1209,15 @@ impl<M: ABIMachineSpec> ABICallee for ABICalleeImpl<M> {
|
|||||||
let spill_off = islot * M::word_bytes() as i64;
|
let spill_off = islot * M::word_bytes() as i64;
|
||||||
let sp_off = self.stackslots_size as i64 + spill_off;
|
let sp_off = self.stackslots_size as i64 + spill_off;
|
||||||
trace!("load_spillslot: slot {:?} -> sp_off {}", slot, sp_off);
|
trace!("load_spillslot: slot {:?} -> sp_off {}", slot, sp_off);
|
||||||
|
|
||||||
|
// Integer types smaller than word size have been spilled as words below,
|
||||||
|
// and therefore must be reloaded in the same type.
|
||||||
|
let ty = if ty.is_int() && ty.bytes() < M::word_bytes() {
|
||||||
|
M::word_type()
|
||||||
|
} else {
|
||||||
|
ty
|
||||||
|
};
|
||||||
|
|
||||||
gen_load_stack_multi::<M>(StackAMode::NominalSPOffset(sp_off, ty), into_regs, ty)
|
gen_load_stack_multi::<M>(StackAMode::NominalSPOffset(sp_off, ty), into_regs, ty)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ block0(v0: i32, v1: i32, v2: i32):
|
|||||||
;; This should be movq below, not movl.
|
;; This should be movq below, not movl.
|
||||||
; nextln: movq %rsi, rsp(0 + virtual offset)
|
; nextln: movq %rsi, rsp(0 + virtual offset)
|
||||||
|
|
||||||
; nextln: movslq rsp(0 + virtual offset), %rsi
|
; nextln: movq rsp(0 + virtual offset), %rsi
|
||||||
; nextln: addl %edi, %esi
|
; nextln: addl %edi, %esi
|
||||||
|
|
||||||
;; Put an effectful instruction so that the live-ranges of the adds and
|
;; Put an effectful instruction so that the live-ranges of the adds and
|
||||||
|
|||||||
Reference in New Issue
Block a user