This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] Invalid constraints on SPARC f?tox and fxto?
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Andrew Over <andrew dot over at cs dot anu dot edu dot au>
- Cc: binutils at sources dot redhat dot com, Eric Botcazou <ebotcazou at libertysurf dot fr>, Bill Clarke <llib at computer dot org>
- Date: Sun, 18 Jan 2004 22:43:11 +0100
- Subject: Re: [PATCH] Invalid constraints on SPARC f?tox and fxto?
- References: <20040108113148.A24141@cs.anu.edu.au>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Jan 08, 2004 at 11:31:49AM +1100, Andrew Over wrote:
> Hi All.
>
> I've recently been looking into gcc bug 10904, which involves gcc
> generating instructions such as:
>
> fdtox %f8,%f7
>
> on SPARC64 [1].
>
> Sun's assembler chokes on this construct, while gas silently accepts it
> (and according to Sun's disassembler, the %f7 is encoded as %f38). One
> consequence of this is that when using gas with gcc on sparc64, the
> (broken) assembly is silently misassembled.
Thanks, I've commited your patch.
I've also commited following gas patch to prevent things like:
fadds %f34, %f38, %f42
assembling silently into:
fadds %f3, %f7, %f11
2004-01-19 Jakub Jelinek <jakub@redhat.com>
* config/tc-sparc.c (sparc_ip): Disallow %f32-%f63 for single
precision operands.
--- gas/config/tc-sparc.c.jj 2003-11-22 12:16:13.000000000 +0100
+++ gas/config/tc-sparc.c 2004-01-19 00:38:43.000000000 +0100
@@ -1,6 +1,6 @@
/* tc-sparc.c -- Assemble for the SPARC
Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003
+ 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -2146,6 +2146,12 @@ sparc_ip (str, pinsn)
{
if (SPARC_OPCODE_ARCH_V9_P (max_architecture))
{
+ if (*args == 'e' || *args == 'f' || *args == 'g')
+ {
+ error_message
+ = _(": There are only 32 single precision f registers; [0-31]");
+ goto error;
+ }
v9_arg_p = 1;
mask -= 31; /* wrap high bit */
}
Jakub