This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
mn10300: don't accept `mov pc,r[0-7]'
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: 22 Jan 2002 19:39:36 -0200
- Subject: mn10300: don't accept `mov pc,r[0-7]'
- Organization: GCC Team, Red Hat
Back in April last year, I added support for `mov pc,a[0-3]' to AM33
assembly. Unfortunately, it didn't occur to me that the way I had
introduced it would cause `mov pc,non-address-register' to be accepted
too, and in such a way that would cause an incorrect instruction to be
encoded. For example, `mov pc,r7' would silently be assembled as `mov
sp,r7'. Oops.
Here's a patch that fixes the problem. I've tried to introduce a
negative test for the inappropriately-supported instructions, but I
couldn't figure out how to do it. I'd appreciate any clues/pointers
as to how to do it. Thanks in advance.
Meanwhile, here's the patch. Ok to install?
Index: gas/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* config/tc-mn10300.c (xr_registers): Move `pc'...
(other_registers): ... here.
Index: gas/config/tc-mn10300.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mn10300.c,v
retrieving revision 1.33
diff -u -p -r1.33 tc-mn10300.c
--- gas/config/tc-mn10300.c 2001/11/15 21:28:57 1.33
+++ gas/config/tc-mn10300.c 2002/01/22 21:32:58
@@ -212,7 +212,6 @@ static const struct reg_name xr_register
{ "mcrl", 3 },
{ "mcvf", 4 },
{ "mdrq", 1 },
- { "pc", 0 },
{ "sp", 0 },
{ "xr0", 0 },
{ "xr1", 1 },
@@ -238,6 +237,7 @@ static const struct reg_name xr_register
static const struct reg_name other_registers[] =
{
{ "mdr", 0 },
+ { "pc", 0 },
{ "psw", 0 },
{ "sp", 0 },
};
--
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