This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

d10v: reject pre-increment


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]