summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2013-10-24 09:37:18 +0000
committerTim Northover <tnorthover@apple.com>2013-10-24 09:37:18 +0000
commitcdd776d13f799da1aff4b2c9c58a236bee74ea2e (patch)
treebe61fe1dc84ff8f381bd9e462019b12d9d4f147d
parent1a03bec22798a8a07147e7caf47d581841ac9337 (diff)
downloadllvm-cdd776d13f799da1aff4b2c9c58a236bee74ea2e.tar.gz
llvm-cdd776d13f799da1aff4b2c9c58a236bee74ea2e.tar.bz2
llvm-cdd776d13f799da1aff4b2c9c58a236bee74ea2e.tar.xz
ARM: fix assert on unpredictable POP instruction.
POP instructions are aliased to the ARM LDM variants but have different syntax. This caused two problems: we tried to access a non-existent operand to annotate the '!', and the error message didn't make much sense. With some vigorous hand-waving in the error message both problems can be fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193322 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/AsmParser/ARMAsmParser.cpp5
-rw-r--r--test/MC/ARM/diagnostics.s8
-rw-r--r--test/MC/ARM/thumb-diagnostics.s4
3 files changed, 9 insertions, 8 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index 534771b0a2..97b9db9236 100644
--- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -5466,9 +5466,8 @@ validateInstruction(MCInst &Inst,
case ARM::t2STMIA_UPD:
case ARM::t2STMDB_UPD: {
if (listContainsReg(Inst, 3, Inst.getOperand(0).getReg()))
- return Error(Operands[4]->getStartLoc(),
- "writeback operator '!' not allowed when base register "
- "in register list");
+ return Error(Operands.back()->getStartLoc(),
+ "writeback register not allowed in register list");
break;
}
case ARM::tMUL: {
diff --git a/test/MC/ARM/diagnostics.s b/test/MC/ARM/diagnostics.s
index 5eae4d216e..4942ba06cf 100644
--- a/test/MC/ARM/diagnostics.s
+++ b/test/MC/ARM/diagnostics.s
@@ -433,6 +433,8 @@
ldm r2!, {r2, r3}
ldmdb r2!, {r2, r3}
ldmda r2!, {r2, r3}
-@ CHECK-ERRORS: error: writeback operator '!' not allowed when base register in register list
-@ CHECK-ERRORS: error: writeback operator '!' not allowed when base register in register list
-@ CHECK-ERRORS: error: writeback operator '!' not allowed when base register in register list
+ popeq {sp}
+@ CHECK-ERRORS: error: writeback register not allowed in register list
+@ CHECK-ERRORS: error: writeback register not allowed in register list
+@ CHECK-ERRORS: error: writeback register not allowed in register list
+@ CHECK-ERRORS: error: writeback register not allowed in register list
diff --git a/test/MC/ARM/thumb-diagnostics.s b/test/MC/ARM/thumb-diagnostics.s
index 8b55e3740d..19d17c2dee 100644
--- a/test/MC/ARM/thumb-diagnostics.s
+++ b/test/MC/ARM/thumb-diagnostics.s
@@ -71,7 +71,7 @@ error: invalid operand for instruction
@ CHECK-ERRORS-V8: error: writeback operator '!' not allowed when base register in register list
@ CHECK-ERRORS-V8: ldm r2!, {r2, r3, r4, r10}
@ CHECK-ERRORS-V8: ^
-@ CHECK-ERRORS-V8: error: writeback operator '!' not allowed when base register in register list
+@ CHECK-ERRORS-V8: error: writeback register not allowed in register list
@ CHECK-ERRORS-V8: ldmdb r2!, {r2, r3, r4}
@ CHECK-ERRORS-V8: ^
@@ -100,7 +100,7 @@ error: invalid operand for instruction
@ CHECK-ERRORS-V8: error: writeback operator '!' not allowed when base register in register list
@ CHECK-ERRORS-V8: stm r2!, {r2, r9}
@ CHECK-ERRORS-V8: ^
-@ CHECK-ERRORS-V8: error: writeback operator '!' not allowed when base register in register list
+@ CHECK-ERRORS-V8: error: writeback register not allowed in register list
@ CHECK-ERRORS-V8: stmdb r2!, {r0, r2}
@ CHECK-ERRORS-V8: ^