public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* libgo patch committed: Copy runtime_printf from other library
@ 2012-05-24 20:45 Ian Lance Taylor
       [not found] ` <4FE67012.2000703@chamberlain.net.au>
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Lance Taylor @ 2012-05-24 20:45 UTC (permalink / raw)
  To: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 543 bytes --]

This patch to libgo copies the implementation of runtime_printf from the
other Go library, and use that instead of calling the C library printf
function.  This removes some unnecessary differences in shared files,
and removes some unnecessary stack splits.  However, the main reason I'm
doing it is to pick up the support for sending the printf output into a
goroutine-specific buffer, used to implement runtime.Stack, coming up
next.  Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline and 4.7 branch.

Ian


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 589 bytes --]

diff -r d99f020243e7 libgo/runtime/go-callers.c
--- a/libgo/runtime/go-callers.c	Tue May 22 09:54:14 2012 -0700
+++ b/libgo/runtime/go-callers.c	Tue May 22 14:50:06 2012 -0700
@@ -72,5 +72,8 @@
 int
 Callers (int skip, struct __go_open_array pc)
 {
-  return runtime_callers (skip, (uintptr *) pc.__values, pc.__count);
+  /* In the Go 1 release runtime.Callers has an off-by-one error,
+     which we can not correct because it would break backward
+     compatibility.  Adjust SKIP here to be compatible.  */
+  return runtime_callers (skip - 1, (uintptr *) pc.__values, pc.__count);
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-24  3:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-24 20:45 libgo patch committed: Copy runtime_printf from other library Ian Lance Taylor
     [not found] ` <4FE67012.2000703@chamberlain.net.au>
2012-06-24  6:59   ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).