target/6788: multiple inheritance "non-virtual thunk" assembly incorrect on sparc64-sun-solars2.8

Brad Spencer spencer@infointeractive.com
Fri May 24 08:13:00 GMT 2002


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



More information about the Binutils mailing list