From 8ebe7d700a87965d2ddb33f763f1ca4bd3bbf484 Mon Sep 17 00:00:00 2001 From: Jim Grosbach <grosbach@apple.com> Date: Tue, 19 Jul 2011 19:45:44 +0000 Subject: [PATCH] Tighten conditional for 'mov' cc_out. Make sure we only clobber the cc_out operand if it is indeed a default non-setting operand. llvm-svn: 135506 --- lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 9f6bd270bd0..1013ecf3ad8 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -2188,7 +2188,8 @@ bool ARMAsmParser::ParseInstruction(StringRef Name, SMLoc NameLoc, // to check the type of the parsed immediate operand. if (Mnemonic == "mov" && Operands.size() > 4 && !static_cast<ARMOperand*>(Operands[4])->isARMSOImm() && - static_cast<ARMOperand*>(Operands[4])->isImm0_65535Expr()) { + static_cast<ARMOperand*>(Operands[4])->isImm0_65535Expr() && + static_cast<ARMOperand*>(Operands[1])->getReg() == 0) { ARMOperand *Op = static_cast<ARMOperand*>(Operands[1]); Operands.erase(Operands.begin() + 1); delete Op;