aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocLocal.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-06-16 06:57:29 +0000
committerChris Lattner <sabre@nondot.org>2004-06-16 06:57:29 +0000
commitaebcce840429a2f9dd0a17c300a91901528cb953 (patch)
treedb94ffec910323f65ecf255c2037f37044ee61e2 /lib/CodeGen/RegAllocLocal.cpp
parent59108d3d4010e6d9c4e289cc113a9f6d79da5aca (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14195 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLocal.cpp')
-rw-r--r--lib/CodeGen/RegAllocLocal.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp
index d0df2703c2..4c7ccdf875 100644
--- a/lib/CodeGen/RegAllocLocal.cpp
+++ b/lib/CodeGen/RegAllocLocal.cpp
@@ -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])) {