Due to a typo in the original code, registers past 115 are handled
incorrectly in setjmp. This was found through some artificial testing.
Most programs don't use that many registers and won't be affected by the
bug. Still, a bug is a bug. A patch which resolves this issue is
attached.
2006-12-13 Joel Schopp <jschopp@austin.ibm.com>
* spu/setjmp.S: fix to handle registers past 115 correctly
------------------------------------------------------------------------
Index: newlib-1.14.0/newlib/libc/machine/spu/setjmp.S
===================================================================
--- newlib-1.14.0.orig/newlib/libc/machine/spu/setjmp.S
+++ newlib-1.14.0/newlib/libc/machine/spu/setjmp.S
@@ -72,23 +72,23 @@ setjmp:
stqd $112, 34*16($3)
stqd $113, 35*16($3)
stqd $114, 36*16($3)
- stqd $115, 36*16($3)
- stqd $116, 37*16($3)
- stqd $117, 38*16($3)
- stqd $118, 39*16($3)
- stqd $119, 40*16($3)
+ stqd $115, 37*16($3)
+ stqd $116, 38*16($3)
+ stqd $117, 39*16($3)
+ stqd $118, 40*16($3)
+ stqd $119, 41*16($3)
hbr setjmp_ret, $0
lnop # pipe1 bubble added for instruction fetch
- stqd $120, 41*16($3)
- stqd $121, 42*16($3)
- stqd $122, 43*16($3)
- stqd $123, 44*16($3)
- stqd $124, 45*16($3)
- stqd $125, 46*16($3)
- stqd $126, 47*16($3)
- stqd $127, 48*16($3)
+ stqd $120, 42*16($3)
+ stqd $121, 43*16($3)
+ stqd $122, 44*16($3)
+ stqd $123, 45*16($3)
+ stqd $124, 46*16($3)
+ stqd $125, 47*16($3)
+ stqd $126, 48*16($3)
+ stqd $127, 49*16($3)
stqd $0, 0*16($3)
stqd $1, 1*16($3)