Bad bad bug. findRegisterUseOperand() returns -1 if a use if not found.
authorEvan Cheng <evan.cheng@apple.com>
Tue, 3 Apr 2007 06:43:29 +0000 (06:43 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 3 Apr 2007 06:43:29 +0000 (06:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35618 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegisterScavenging.cpp

index 06368639b8c2e71b262c9a9758d51f42a22975a3..13a361991959d717419b12df073538a0ab0f9592 100644 (file)
@@ -235,7 +235,7 @@ static unsigned calcDistanceToUse(MachineBasicBlock *MBB,
   I = next(I);
   while (I != MBB->end()) {
     Dist++;
-    if (I->findRegisterUseOperand(Reg))
+    if (I->findRegisterUseOperand(Reg) != -1)
         return Dist;
     I = next(I);    
   }