This patch to the libgo garbage collector ensures that we save all the registers on the stack when starting a GC. Otherwise we could sometimes miss a value held in a register while scanning the stack of the goroutine running the GC. This never happened on x86, but it did happen on SPARC. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
Ian
diff -r 1f6696441eeb libgo/runtime/mgc0.c --- a/libgo/runtime/mgc0.c Fri Feb 10 06:07:07 2012 -0800 +++ b/libgo/runtime/mgc0.c Fri Feb 10 07:50:20 2012 -0800 @@ -936,6 +936,10 @@ const byte *p; bool extra; + // Make sure all registers are saved on stack so that + // scanstack sees them. + __builtin_unwind_init(); + // The gc is turned off (via enablegc) until // the bootstrap has completed. // Also, malloc gets called in the guts