My registers spilleth over... (fwd)

Ian Lance Taylor ian@cygnus.com
Tue Aug 15 14:30:00 GMT 1995


   From: hjl@nynexst.com (H.J. Lu)
   Date: Tue, 15 Aug 95 16:30:38 EDT

   Forwarded message:
   From: Jim Paradis <paradis@amt.tay1.dec.com>
   Date: Thu, 3 Aug 1995 21:20:07 -0500 (EDT)

   (linux-gcc people can tune in now):  The first bug I found was when my
   freshly-built gas tried to build a "dummy" Alpha object file (basically, a
   six-line bit of assembly code that's nothing more than a single routine
   consiisting of a single "ret" instruction).  gas fell over dead when it
   tried to build it: got "Assertion failed in write.c".  Much tracking down
   finally got me to the following line of code:

	   fragp->fr_offset += newsize - size;

   All of the variables above are 64-bit "long long"'s.  newsize=16, size=12;
   therefore fragp->fr_offset should have been incremented by 12.  Instead it
   was incremented by 24.  I figure this is a bug in the handling of
   "long long"s by the i486 code generator; if I break the above apart into
   two statements:

	   fragp->fr_offset = fragp->fr_offset + newsize;
	   fragp->fr_offset = fragp->fr_offset - size;

   then everything works fine.

Note that this is a compiler bug.  Nothing needs to be changed in gas.

Ian




More information about the Gas2 mailing list