From f6a9988ceab0ca660fa4f4e89d8d683f487118eb Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 31 Oct 2008 04:00:23 +0000 Subject: Don't skip over all "terminator" instructions when determining where to put the callee-saved restore code. It could skip over conditional jumps accidentally. Instead, just skip the "return" instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58489 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/PrologEpilogInserter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/PrologEpilogInserter.cpp') diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp index d3b0b11c70..2469c8e000 100644 --- a/lib/CodeGen/PrologEpilogInserter.cpp +++ b/lib/CodeGen/PrologEpilogInserter.cpp @@ -273,10 +273,10 @@ void PEI::saveCalleeSavedRegisters(MachineFunction &Fn) { MBB = FI; I = MBB->end(); --I; - // Skip over all terminator instructions, which are part of the return + // Skip over all "return" instructions, which are part of the return // sequence. MachineBasicBlock::iterator I2 = I; - while (I2 != MBB->begin() && (--I2)->getDesc().isTerminator()) + while (I2 != MBB->begin() && (--I2)->getDesc().isReturn()) I = I2; bool AtStart = I == MBB->begin(); -- cgit v1.2.3