This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Fix m68k error printing
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Ben Elliston <bje at au1 dot ibm dot com>, binutils at sources dot redhat dot com
- Date: Wed, 15 Nov 2006 16:38:24 +0000
- Subject: Fix m68k error printing
I discovered the code that prints out the list of cpus that support a particular
instruction was broken. For instance
fsmull %fp0,%fp2
will print
tst.s:1: Error: invalid instruction for this architecture; needs 68040 [68ec030,
68ec040], 68060 [68ec040, 68ec060], 547x [5475, 5474, 5473, 5472, 5471, 5470,
5480, 5481, 5482, 5483, 5484, 5485], 548x [5485, 5484, 5483, 5482, 5481, 5480]
-- statement `fsmull %fp0,%fp2' ignored
which, if you look carefully, repeats various processors several times. With
this patch, the output is now,
tst.s:1: Error: invalid instruction for this architecture; needs 68040
[68ec040], 68060 [68ec060], 547x [5470, 5471, 5472, 5473, 5474, 5475], 548x
[5480, 5481, 5482, 5483, 5484, 5485] -- statement `fsmull %fp0,%fp2' ignored
which is better.
ok?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2006-11-15 Nathan Sidwell <nathan@codesourcery.com>
* config/tc-m68k.c (m68k_ip): Correct output of cpu aliases.
Index: config/tc-m68k.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-m68k.c,v
retrieving revision 1.77
diff -c -3 -p -r1.77 tc-m68k.c
*** config/tc-m68k.c 19 May 2006 11:26:11 -0000 1.77
--- config/tc-m68k.c 15 Nov 2006 16:33:48 -0000
*************** m68k_ip (char *instring)
*** 2061,2089 ****
if (!cpu->alias && (cpu->arch & ok_arch))
{
const struct m68k_cpu *alias;
!
if (any)
APPEND (", ");
any = 0;
APPEND (cpu->name);
! APPEND (" [");
! if (cpu != m68k_cpus)
! for (alias = cpu - 1; alias->alias; alias--)
{
! if (any)
! APPEND (", ");
! APPEND (alias->name);
! any = 1;
}
! for (alias = cpu + 1; alias->alias; alias++)
! {
! if (any)
! APPEND (", ");
! APPEND (alias->name);
! any = 1;
! }
!
! APPEND ("]");
any = 1;
}
if (paren)
--- 2061,2091 ----
if (!cpu->alias && (cpu->arch & ok_arch))
{
const struct m68k_cpu *alias;
! int seen_master = 0;
!
if (any)
APPEND (", ");
any = 0;
APPEND (cpu->name);
! for (alias = cpu; alias != m68k_cpus; alias--)
! if (alias[-1].alias >= 0)
! break;
! for (; !seen_master || alias->alias > 0; alias++)
{
! if (!alias->alias)
! seen_master = 1;
! else
! {
! if (any)
! APPEND (", ");
! else
! APPEND (" [");
! APPEND (alias->name);
! any = 1;
! }
}
! if (any)
! APPEND ("]");
any = 1;
}
if (paren)