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]

[PATCH] : SH Assembler generates parse error for MOD instructions


Hi !

The SH assembler generates parse error for 'mod' instructions.

Examples
	ldc R1,mod
	ldc.l @R0+,mod
	stc.l mod,@-R0
	stc mod,R1

This bug was found on gcc mailing list.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=g
cc&pr=5472

The following patch corrects this. I have also verified that it does not
cause any
side effect on other DSP instructions.

Regards,
Arati Dikey


Changelog 
	2002-01-30  Arati Dikey <aratid@kpit.com>

	tc-sh.c (): Incorrect index causes parse error for mod, ix, iy
regs.



--- tc-sh.c.org	Tue Jan 29 17:47:35 2002
+++ tc-sh.c	Wed Jan 30 14:50:32 2002
@@ -578,7 +578,7 @@ parse_reg (src, mode, reg)
 	}
     }
 
-  if (l0 == 'i' && l1 && ! IDENT_CHAR ((unsigned char) src[3]))
+  if (l0 == 'i' && l1 && ! IDENT_CHAR ((unsigned char) src[2]))
     {
       if (l1 == 's')
 	{
@@ -713,7 +713,7 @@ parse_reg (src, mode, reg)
 	}
     }
   if (l0 == 'm' && l1 == 'o' && tolower (src[2]) == 'd'
-      && ! IDENT_CHAR ((unsigned char) src[4]))
+      && ! IDENT_CHAR ((unsigned char) src[3]))
     {
       *mode = A_MOD;
       return 3;

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNUSH tool chain for Hitachi's SH Series.
The following site also offers free support to European customers.
Read more at http://www.kpit.com/products/support.htm.
Latest version of GNUSH is released on Jan 1, 2002.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 


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