This is the mail archive of the
mailing list for the GCC project.
libgo patch committed: Save all registers on stack for GC scan
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Fri, 10 Feb 2012 07:52:39 -0800
- Subject: libgo patch committed: Save all registers on stack for GC scan
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.
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;
+ // Make sure all registers are saved on stack so that
+ // scanstack sees them.
// The gc is turned off (via enablegc) until
// the bootstrap has completed.
// Also, malloc gets called in the guts