python-greenlet/greenlet — pull request #58 by madisongh (2014-09-18 19:50:49+00:00)
Title: Re-code the saving of the gp register for MIPS64 so it compiles

In working on a project that wants to use greenlet on a MIPS64-based Linux system, I ran into the following compilation error:

In file included from slp_platformselect.h:36:0,
from greenlet.c:416:
platform/switch_mips_unix.h: In function 'slp_switch':
platform/switch_mips_unix.h:26:5: error: PIC register clobbered by '$28' in 'asm'
__asm__ __volatile__ ("" : : : REGS_TO_SAVE);
^
platform/switch_mips_unix.h:41:5: error: PIC register clobbered by '$28' in 'asm'
__asm__ __volatile__ ("" : : : REGS_TO_SAVE);
^

This was using gcc 4.7 and 4.9. To fix this, I came up with this alternative way of saving the gp register. The generated assembly looks correct, and all tests are passing.