This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch, AArch64, 5/5] backport recent fixes to 2.23 - fix sysreg diagnostics
- From: Yufeng Zhang <Yufeng dot Zhang at arm dot com>
- To: binutils at sourceware dot org
- Cc: gingold at adacore dot com, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>
- Date: Mon, 11 Feb 2013 23:00:53 +0000
- Subject: Re: [Patch, AArch64, 5/5] backport recent fixes to 2.23 - fix sysreg diagnostics
- References: <51197585.2040508@arm.com>
This patch fixes the incorrect diagnostics on illegal system registers.
It was committed to the trunk at:
http://sourceware.org/ml/binutils-cvs/2013-01/msg00048.html
OK for 2_23-branch?
Thanks,
Yufeng
gas/
* config/tc-aarch64.c (parse_operands): Change to compare the result
of function call 'parse_sys_reg' with 'PARSE_FAIL' instead of 'FALSE'.
gas/testsuite/
* gas/aarch64/diagnostic.s: Add test.
* gas/aarch64/diagnostic.l: Update.
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index b62bd7a..0ec40e7 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -1,6 +1,7 @@
/* tc-aarch64.c -- Assemble for the AArch64 ISA
- Copyright 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright 2009, 2010, 2011, 2012, 2013
+ Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GAS.
@@ -5003,7 +5004,8 @@ parse_operands (char *str, const aarch64_opcode *opcode)
break;
case AARCH64_OPND_SYSREG:
- if ((val = parse_sys_reg (&str, aarch64_sys_regs_hsh, 1)) == FALSE)
+ if ((val = parse_sys_reg (&str, aarch64_sys_regs_hsh, 1))
+ == PARSE_FAIL)
{
set_syntax_error (_("unknown or missing system register name"));
goto failure;
@@ -5012,7 +5014,8 @@ parse_operands (char *str, const aarch64_opcode *opcode)
break;
case AARCH64_OPND_PSTATEFIELD:
- if ((val = parse_sys_reg (&str, aarch64_pstatefield_hsh, 0)) == FALSE)
+ if ((val = parse_sys_reg (&str, aarch64_pstatefield_hsh, 0))
+ == PARSE_FAIL)
{
set_syntax_error (_("unknown or missing PSTATE field name"));
goto failure;
diff --git a/gas/testsuite/gas/aarch64/diagnostic.l b/gas/testsuite/gas/aarch64/diagnostic.l
index 714a2f0..cd8b3e2 100644
--- a/gas/testsuite/gas/aarch64/diagnostic.l
+++ b/gas/testsuite/gas/aarch64/diagnostic.l
@@ -85,3 +85,4 @@
[^:]*:87: Error: immediate offset out of range -256 to 252 at operand 3 -- `ldnp w7,w15,\[x3,#256\]'
[^:]*:88: Error: shift is not permitted at operand 2 -- `movi v1.2d,4294967295,lsl#0'
[^:]*:89: Error: shift amount non-zero at operand 2 -- `movi v1.8b,97,lsl#8'
+[^:]*:90: Error: unknown or missing system register name at operand 1 -- `msr dummy,x1'
diff --git a/gas/testsuite/gas/aarch64/diagnostic.s b/gas/testsuite/gas/aarch64/diagnostic.s
index 2b1c01c..1fa1b74 100644
--- a/gas/testsuite/gas/aarch64/diagnostic.s
+++ b/gas/testsuite/gas/aarch64/diagnostic.s
@@ -87,3 +87,4 @@
ldnp w7, w15, [x3, #256]
movi v1.2d, 4294967295, lsl #0
movi v1.8b, 97, lsl #8
+ msr dummy, x1