This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: target/6788: multiple inheritance "non-virtual thunk" assembly incorrect on sparc64-sun-solars2.8
- From: Brad Spencer <spencer at infointeractive dot com>
- To: rth at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org,nobody at gcc dot gnu dot org, spencer at aol dot net, gcc-gnats at gcc dot gnu dot org
- Cc: binutils at sources dot redhat dot com
- Date: Fri, 24 May 2002 12:11:14 -0300
- Subject: Re: target/6788: multiple inheritance "non-virtual thunk" assembly incorrect on sparc64-sun-solars2.8
- References: <20020524042416.28451.qmail@sources.redhat.com>
I'm copying this to the binutils mailing list for comment. Sorry for
the lack of context there. Scroll down...
On Fri, May 24, 2002 at 04:24:16AM -0000, rth@gcc.gnu.org wrote:
> Synopsis: multiple inheritance "non-virtual thunk" assembly incorrect on sparc64-sun-solars2.8
>
> Responsible-Changed-From-To: unassigned->rth
> Responsible-Changed-By: rth
> Responsible-Changed-When: Thu May 23 21:24:16 2002
> Responsible-Changed-Why:
> .
> State-Changed-From-To: open->analyzed
> State-Changed-By: rth
> State-Changed-When: Thu May 23 21:24:16 2002
> State-Changed-Why:
> Probably an assembler bug. GCC emits the assembler macro
> set -16392, %g1
> which should have done the right thing. I guess we have
> to do this by hand here.
>
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6788
I have been able to work around this bug by patching gas-2.12.1 as
shown below. I still suspect that this is a gcc bug, because I can't
see why the assembler would be wrong about "set" not taking negative
values. Isn't that what "setsw" is for?
I've basically taken the warning case and made it treat the "set" as a
"setsw". I figure that this does workaround the problem and it would
only break already broken instructions at the most (or at least mostly
:).
The patch:
*** tc-sparc.c.orig Fri May 24 09:16:54 2002
--- tc-sparc.c Fri May 24 12:09:41 2002
***************
*** 1025,1032 ****
{
if (sizeof (offsetT) > 4
&& (the_insn.exp.X_add_number < 0
! || the_insn.exp.X_add_number > (offsetT) U0xffffffff))
! as_warn (_("set: number not in 0..4294967295 range"));
}
else
{
--- 1025,1038 ----
{
if (sizeof (offsetT) > 4
&& (the_insn.exp.X_add_number < 0
! || the_insn.exp.X_add_number > (offsetT) U0xffffffff)) {
! /* gcc-3.1 incorrectly generates set -x,%reg for certain cases
! (see PR c++/6788) */
! as_warn (_("set: number not in 0..4294967295 range, "
! "treating as setsw"));
! synthetize_setsw(insn);
! return;
! }
}
else
{
--
-----------------------------------------------------------------
Brad Spencer - spencer@infointeractive.com - "It's quite nice..."
Systems Architect | InfoInterActive Corp. | An AOL Company