Fix a recent regression in Applications/sgefa that Alkis pointed out to me.

The vector may actually be empty if the register that we are marking as
recently used is not actually allocatable.  This happens for physical registers
that are not allocatable, like the ST(x) registers on X86.

llvm-svn: 14195
This commit is contained in:
Chris Lattner 2004-06-16 06:57:29 +00:00
parent 3b9474ecd7
commit 6f4a596234
1 changed files with 2 additions and 2 deletions

View File

@ -93,8 +93,8 @@ namespace {
}
void MarkPhysRegRecentlyUsed(unsigned Reg) {
assert(!PhysRegsUseOrder.empty() && "No registers used!");
if (PhysRegsUseOrder.back() == Reg) return; // Already most recently used
if(PhysRegsUseOrder.empty() ||
PhysRegsUseOrder.back() == Reg) return; // Already most recently used
for (unsigned i = PhysRegsUseOrder.size(); i != 0; --i)
if (areRegsEqual(Reg, PhysRegsUseOrder[i-1])) {