Correction to r270219: fix detection of invalid frame index

llvm-svn: 270220
This commit is contained in:
Krzysztof Parzyszek 2016-05-20 14:34:03 +00:00
parent 70b1eee793
commit ce6f3bdee4
1 changed files with 2 additions and 1 deletions

View File

@ -438,7 +438,8 @@ unsigned RegScavenger::scavengeRegister(const TargetRegisterClass *RC,
// otherwise, use the emergency stack spill slot.
if (!TRI->saveScavengerRegister(*MBB, I, UseMI, RC, SReg)) {
// Spill the scavenged register before I.
if (Scavenged[SI].FrameIndex < 0) {
int FI = Scavenged[SI].FrameIndex;
if (FI < FIB || FI >= FIE) {
Twine Msg = Twine("Error while trying to spill ") + TRI->getName(SReg) +
" from class " + TRI->getRegClassName(RC) +
": Cannot scavenge register without an emergency spill slot!";