diff --git a/lib/Target/X86/X86ISelDAGToDAG.cpp b/lib/Target/X86/X86ISelDAGToDAG.cpp index e895b045f1d..1b9212b5bf9 100644 --- a/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -220,7 +220,7 @@ static SDNode *findFlagUse(SDNode *N) { SDNode *User = *I; for (unsigned i = 0, e = User->getNumOperands(); i != e; ++i) { SDOperand Op = User->getOperand(i); - if (Op.ResNo == FlagResNo) + if (Op.Val == N && Op.ResNo == FlagResNo) return User; } }