mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-25 17:20:48 +00:00
Fix PEI to not walk off the start of a block when an updated instruction
is the first in its block. This is PR3842. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67304 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -533,10 +533,14 @@ void PEI::replaceFrameIndices(MachineFunction &Fn) {
|
|||||||
|
|
||||||
SPAdj += Size;
|
SPAdj += Size;
|
||||||
|
|
||||||
MachineBasicBlock::iterator PrevI = prior(I);
|
MachineBasicBlock::iterator PrevI = BB->end();
|
||||||
|
if (I != BB->begin()) PrevI = prior(I);
|
||||||
TRI.eliminateCallFramePseudoInstr(Fn, *BB, I);
|
TRI.eliminateCallFramePseudoInstr(Fn, *BB, I);
|
||||||
|
|
||||||
// Visit the instructions created by eliminateCallFramePseudoInstr().
|
// Visit the instructions created by eliminateCallFramePseudoInstr().
|
||||||
|
if (PrevI == BB->end())
|
||||||
|
I = BB->begin(); // The replaced instr was the first in the block.
|
||||||
|
else
|
||||||
I = next(PrevI);
|
I = next(PrevI);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user