This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [libgo] Reduce fmt_test.TestScanInts recursion depth (PR go/48553)
- From: Ian Lance Taylor <iant at google dot com>
- To: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- Cc: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Fri, 22 Apr 2011 17:09:33 -0700
- Subject: Re: [libgo] Reduce fmt_test.TestScanInts recursion depth (PR go/48553)
- References: <yddoc43o4mw.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
> As described in the PR, fmt FAILs on targets without split-stack support
> (anything but Linux, it seems) since the 32-bit TestScanInts tests
> overflows the default thread stack of 1 MB. To avoid this, I've reduced
> the recursion depth from 1000 to 800 which lets the test pass.
Thanks. Committed upstream and brought back to libgo as follows.
Committed to mainline.
Ian
diff -r 62a12171bf58 libgo/go/fmt/scan_test.go
--- a/libgo/go/fmt/scan_test.go Fri Apr 22 17:00:44 2011 -0700
+++ b/libgo/go/fmt/scan_test.go Fri Apr 22 17:06:09 2011 -0700
@@ -810,7 +810,9 @@
})
}
-const intCount = 1000
+// 800 is small enough to not overflow the stack when using gccgo on a
+// platform that does not support split stack.
+const intCount = 800
func testScanInts(t *testing.T, scan func(*RecursiveInt, *bytes.Buffer) os.Error) {
r := new(RecursiveInt)