This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
d10v: reject pre-increment
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: 29 Nov 2001 15:11:10 -0200
- Subject: d10v: reject pre-increment
- Organization: GCC Team, Red Hat
The d10v assembler used to silently turn @+r# into @r#+, since postfix
would remove the `+' operator regardless of its being in front of the
register name. This patch arranges for the `+' to be turned into a
separate token after the ATSIGN, such that it is rejected. Another
alternative I considered was to simply not call postfix() if *p=='+',
such that we'd parse `+r#' as an expression. This would result in
`r2' being referenced as a symbol, not a register. I thought we'd
better report the invalid operand instead. Ok to install?
Index: gas/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* config/tc-d10v.c (get_operands): Emit OPERAND_PLUS for
prefix `+'.
Index: gas/config/tc-d10v.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-d10v.c,v
retrieving revision 1.19
diff -u -p -r1.19 tc-d10v.c
--- gas/config/tc-d10v.c 2001/11/15 21:28:55 1.19
+++ gas/config/tc-d10v.c 2001/11/29 17:08:18
@@ -457,6 +457,11 @@ get_operands (exp)
else
{
exp[numops].X_add_number = OPERAND_ATSIGN;
+ if (*p == '+')
+ {
+ exp[++numops].X_add_number = OPERAND_PLUS;
+ ++p;
+ }
post = postfix (p);
}
numops++;
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me