Skip to content

Commit d49c318

Browse files
authored
[X86] emitEpilogue - silence implicit integer extension warning. (#127185)
Silence compiler warning introduced in #125007 - assign the address delta to int64_t, assert it is negative and negate it only as part of the mergeSPAdd call Fixes #125825
1 parent b227c25 commit d49c318

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Target/X86/X86FrameLowering.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2639,11 +2639,11 @@ void X86FrameLowering::emitEpilogue(MachineFunction &MF,
26392639

26402640
if (Terminator == MBB.end() || !isTailCallOpcode(Terminator->getOpcode())) {
26412641
// Add the return addr area delta back since we are not tail calling.
2642-
int64_t Offset = -1 * X86FI->getTCReturnAddrDelta();
2643-
assert(Offset >= 0 && "TCDelta should never be positive");
2644-
if (Offset) {
2642+
int64_t Delta = X86FI->getTCReturnAddrDelta();
2643+
assert(Delta <= 0 && "TCDelta should never be positive");
2644+
if (Delta) {
26452645
// Check for possible merge with preceding ADD instruction.
2646-
Offset = mergeSPAdd(MBB, Terminator, Offset, true);
2646+
int64_t Offset = mergeSPAdd(MBB, Terminator, -Delta, true);
26472647
emitSPUpdate(MBB, Terminator, DL, Offset, /*InEpilogue=*/true);
26482648
}
26492649
}

0 commit comments

Comments
 (0)