mips64 setjmp fixes

Alexandre Oliva aoliva@redhat.com
Thu Mar 20 08:27:00 GMT 2003


It turned out we didn't have enough room to save some of the registers
in N32, and we didn't save the correct gp in N32 or N64.  This patch
fixes both problems.  Ok?

While at that, I noticed that the gp value that we save in O32 is
entirely useless.  Since gp is not preserved across calls in O32, and
all of the setjmp_aux wrappers set their own gp without restoring the
original one, the value we save is that set by the setjmp_aux function
itself, not that of the caller of whatever setjmp variant is in use.
Which doesn't really matter, since the caller is required to restore
gp anyway.  It's just pointless to save and restore it, given that
we're not saving anything useful.  The only thing this accomplishes is
to make sure setjmp returns the same value for gp every time it
returns, but there's no requirement to do so, AFAIK.  I'm thinking on
O32 we might as well just refrain from saving and restoring gp at
all.  Too bad we can't take it out from the jmpbuf struct.  Comments?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mips64-setlongjmp.patch
Type: text/x-patch
Size: 7109 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20030320/1fc5f099/attachment.bin>
-------------- next part --------------

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


More information about the Libc-alpha mailing list