Index: lib/Target/RISCV/RISCVFrameLowering.cpp =================================================================== --- lib/Target/RISCV/RISCVFrameLowering.cpp +++ lib/Target/RISCV/RISCVFrameLowering.cpp @@ -149,7 +149,7 @@ // FIXME: assumes exactly one instruction is used to restore each // callee-saved register. MachineBasicBlock::iterator LastFrameDestroy = MBBI; - std::advance(LastFrameDestroy, -MFI.getCalleeSavedInfo().size()); + std::advance(LastFrameDestroy, -(int64_t)MFI.getCalleeSavedInfo().size()); uint64_t StackSize = MFI.getStackSize();