MIPS problem with structures/varargs

Jeffrey A Law law@cygnus.com
Fri Sep 3 16:06:00 GMT 1999


  In message < 14288.19259.255664.726231@cetus.cygnus.com >you write:
  > 
  > I assume we'er talking about SGI's original MIPS abi, sometimes called
  > -32 or o32.  Jim certianly understands this stuff better than I, but
  > I'm trying to become the expert here, so I'll throw in what I think
  > I know, and let Jim correct me if necessary.
  > 
  > Mark Mitchell writes:
  >  > In other words, `x[0]' and `x[1]' get put in $6 and $7, and
  >  > left-shifted so that they are the most significant bytes.  That seems
  >  > right to me, from reading the ABI.  However, `x[2]' through `x[7]' are
  >  > put in the low-order byte of their stack slots.  As a result, in
  >  > `bar', they are never recovered.
  >  > 
  >  > What's the bug here?  Are `x[0]' and `x[1]' being mishandled, or is
  >  > the way that the arguments are being pushed on the stack?
  > 
  > I think you are correct, that the stack arguments are not being
  > correctly shifted, or, equivalantly, are not being stored into
  > the correct places on the stack.
It's a relatively common problem.  Similar problems plague the PA and PowerPC.

Interestingly enough, I think Jason Eckhardt managed to get this working
on the PA as part of the PA64 port.  The bits seem to appear in the right
places, but I haven't done a strict review of the code yet.

jeff



More information about the Gcc-bugs mailing list