[mips] fix $gp restore bug

Adam Nemet anemet@caviumnetworks.com
Tue Mar 3 01:18:00 GMT 2009


"Maciej W. Rozycki" <macro@linux-mips.org> writes:
> On Mon, 2 Mar 2009, Richard Sandiford wrote:
>> Oh, curse MIPS for not having a MIPS16-like ADDIUSP instruction!
>
>  Let's face it -- it's not the instruction list which is inadequate.  It
> is the decision to make $gp call-clobbered for o32 which was suboptimal.
> There was a reason it got fixed with the advent of the new ABIs (along
> with a number of other issues).

AIUI, the problem exists with the new ABIs as well.  You either ensure that
the GOT pointer is live at each branch pessimizing the code or you need a
different way of fetching the destination address into a register.

Adam



More information about the Gcc-patches mailing list