problem with (long long) - 32786 on mips

Jeffrey A Law law@cygnus.com
Sun Feb 1 00:54:00 GMT 1998


  > On a 32-bit mips platform (mips-sgi-irix5.3), egcs crashes on the
  > following input (this occurs in libbfd):
[ ... ]

  > 
  >  bfd_getb_signed_16
  > libbfd.i: In function `bfd_getb_signed_16':
  > libbfd.i:7: internal error--unrecognizable insn:
  > (insn 20 18 22 (parallel[ 
  >             (set (reg:DI 81)
  >                 (plus:DI (reg:DI 81)
  >                     (const_int -32768)))
  >             (clobber (reg:SI 83))
  >         ] ) -1 (nil)
  >     (nil))
  > 
  > 
  > The crash does not occur if the 32768 above is changed to some other
  > number, like 32767 or 32769.
  > 
  > 
  > I noticed there was some special casing in mips.md for arguments 
  > equal to -32768, apparently to work around problems with some
  > assemblers.  I saw only one of these tests which could possibly be
  > relevant, and i removed it:
  > 
  > 1998-01-30  scott snyder  <snyder@d0sgif.fnal.gov>
  > 
  > 	* config/mips/mips.md (adddi3_internal_2): Remove check for
  > 	-32768.
That change is not correct.

Basically the right change is to make adddi3 & adddi3_internal2 consistent
in how they handle -32768.

When configured for GAS, adddi3 will create the bogus insn you showed
above.  Unfortunately, adddi3_internal2 doesn't accept -32768 when
using GAS, even though GAS handles it correctly.

I believe I've fixed this instance of this problem; however I think
similar problems exist in the subsi/subdi expanders and patterns.

jeff



More information about the Gcc-bugs mailing list