On Mon, Aug 3, 2015 at 2:10 AM, Andreas Schwab <sch...@suse.de> wrote:

> ../../../libgo/runtime/mprof.goc: In function 'runtime_Stack':
> ../../../libgo/runtime/mprof.goc:408:5: error: calling 
> '__builtin_frame_address' with a nonzero argument is unsafe 
> [-Werror=frame-address]
>   sp = runtime_getcallersp(&b);

Fixed by this patch by Chris Manghane.  The call was not actually
necessary.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.  This fixes PR
67101.

Ian
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE     (revision 226510)
+++ gcc/go/gofrontend/MERGE     (working copy)
@@ -1,4 +1,4 @@
-2bf7c643a1d2f8503070c8e6cb87852026e32400
+d5aad2f400a0f21724e33e4ae48e1583ed8b1a87
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/runtime/mprof.goc
===================================================================
--- libgo/runtime/mprof.goc     (revision 226510)
+++ libgo/runtime/mprof.goc     (working copy)
@@ -402,10 +402,9 @@ func ThreadCreateProfile(p Slice) (n int
 }
 
 func Stack(b Slice, all bool) (n int) {
-       byte *pc, *sp;
+       byte *pc;
        bool enablegc;
        
-       sp = runtime_getcallersp(&b);
        pc = (byte*)(uintptr)runtime_getcallerpc(&b);
 
        if(all) {
@@ -423,7 +422,6 @@ func Stack(b Slice, all bool) (n int) {
                g->writebuf = (byte*)b.__values;
                g->writenbuf = b.__count;
                USED(pc);
-               USED(sp);
                runtime_goroutineheader(g);
                runtime_traceback();
                runtime_printcreatedby(g);

Reply via email to