MIPS: fix failure to save all argument registers in varargs function

Alexandre Oliva aoliva@redhat.com
Fri Mar 8 20:01:00 GMT 2002


Whenever the last named argument in a function is passed in a
floating-point register, GCC would fail to save any remaining
argument-passing GP registers in their home locations, so the
arguments passed would be lost.  This was demonstrated with
gcc.c-torture/execute/va-arg-16.c with -mabi=o64 -mlong32 -mgp64, with
both -meb and -mel, on a Red Hat-internal MIPS port.

I don't understand why saving varargs registers is handled in the
prologue for some ABIs and in SETUP_INCOMING_VARARGS in others, but
this patch fixes the o64 bug without breaking any other ABIs.  Tested
with the internal port, and bootstrapped with GCC mainline on
mips-sgi-irix6.5.  Eric Christopher approved this patch, so I'm
checking it in.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mips-o64-save-varargs-regs.patch
Type: text/x-patch
Size: 742 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20020308/cc25cd3a/attachment.bin>
-------------- next part --------------

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


More information about the Gcc-patches mailing list