]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR go/61498 (Many 64-bit Go tests SEGV in scanblock)
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 13 Jun 2014 13:50:13 +0000 (13:50 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 13 Jun 2014 13:50:13 +0000 (13:50 +0000)
PR go/61498
runtime: Always set gcnext_sp to pointer-aligned address.

The gcnext_sp field is only used on systems that do not use
split stacks.  It marks the bottom of the stack for the
garbage collector.  This change makes sure that the stack
bottom is always aligned to a pointer value.

Previously the garbage collector would align all the addresses
that it scanned, but it now expects them to be aligned before
scanning.

From-SVN: r211639

libgo/runtime/proc.c

index 1e1551989cbef7b7eeefeff390d951d6a46fc47d..d21308447171ad0b96eed2fe406a3ad7d6dff44f 100644 (file)
@@ -255,9 +255,6 @@ runtime_mcall(void (*pfn)(G*))
 {
        M *mp;
        G *gp;
-#ifndef USING_SPLIT_STACK
-       int i;
-#endif
 
        // Ensure that all registers are on the stack for the garbage
        // collector.
@@ -273,7 +270,7 @@ runtime_mcall(void (*pfn)(G*))
 #ifdef USING_SPLIT_STACK
                __splitstack_getcontext(&g->stack_context[0]);
 #else
-               gp->gcnext_sp = &i;
+               gp->gcnext_sp = &pfn;
 #endif
                gp->fromgogo = false;
                getcontext(&gp->context);
@@ -1933,7 +1930,7 @@ doentersyscall()
                                       &g->gcinitial_sp);
 #else
        {
-               uint32 v;
+               void *v;
 
                g->gcnext_sp = (byte *) &v;
        }