diff mbox

libgo patch committed: Fix type passed to __splitstack_find

Message ID CAOyqgcXKjV50m=ETaPa0BP8cC8a=aaMy=TF0ErF5Y447mbgLjQ@mail.gmail.com
State New
Headers show

Commit Message

Ian Lance Taylor Sept. 20, 2016, 4:48 p.m. UTC
PR 77642 points out that since the change to generate runtime types
from Go libgo is passing the wrong type to __splitstack_find: it is
passing uintptr* to a function that expects size_t*.  This breaks on
s390.  This patch, based on one from Andreas Krebbel in the PR, fixes
the problem.  Bootstrapped and ran Go testsuite on
x86_64-pc-linux-gnu.  Committed to mainline.

Ian
diff mbox

Patch

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 240146)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@ 
-b34c93bf00ec4f2ad043ec89ff96989e0d1b26aa
+80720773ac1a3433b7de59ffa5c04744123247c3
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/runtime/proc.c
===================================================================
--- libgo/runtime/proc.c	(revision 240053)
+++ libgo/runtime/proc.c	(working copy)
@@ -2052,9 +2052,13 @@  doentersyscall()
 
 	// Leave SP around for GC and traceback.
 #ifdef USING_SPLIT_STACK
-	g->gcstack = __splitstack_find(nil, nil, &g->gcstacksize,
-				       &g->gcnextsegment, &g->gcnextsp,
-				       &g->gcinitialsp);
+	{
+	  size_t gcstacksize;
+	  g->gcstack = __splitstack_find(nil, nil, &gcstacksize,
+					 &g->gcnextsegment, &g->gcnextsp,
+					 &g->gcinitialsp);
+	  g->gcstacksize = (uintptr)gcstacksize;
+	}
 #else
 	{
 		void *v;
@@ -2099,9 +2103,13 @@  runtime_entersyscallblock(void)
 
 	// Leave SP around for GC and traceback.
 #ifdef USING_SPLIT_STACK
-	g->gcstack = __splitstack_find(nil, nil, &g->gcstacksize,
-				       &g->gcnextsegment, &g->gcnextsp,
-				       &g->gcinitialsp);
+	{
+	  size_t gcstacksize;
+	  g->gcstack = __splitstack_find(nil, nil, &gcstacksize,
+					 &g->gcnextsegment, &g->gcnextsp,
+					 &g->gcinitialsp);
+	  g->gcstacksize = (uintptr)gcstacksize;
+	}
 #else
 	g->gcnextsp = (byte *) &p;
 #endif