diff mbox

Go patch committed: Fix error reporting for invalid builtin calls

Message ID CAOyqgcU1Lqn4zqcC4MwHhs5apY9rHWsO1ycQR6ZWWAPyVJCTGQ@mail.gmail.com
State New
Headers show

Commit Message

Ian Lance Taylor Aug. 3, 2015, 5:55 p.m. UTC
On Mon, Aug 3, 2015 at 2:10 AM, Andreas Schwab <schwab@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

Comments

Michael Hudson-Doyle Aug. 4, 2015, 2:24 a.m. UTC | #1
Now I get

../../../gcc/libgo/runtime/mprof.goc: In function ‘runtime_Stack’:
../../../gcc/libgo/runtime/mprof.goc:437:19: error: ‘enablegc’ may be
used uninitialized in this function [-Werror=maybe-uninitialized]
   mstats.enablegc = enablegc;
                   ^
../../../gcc/libgo/runtime/mprof.goc:406:7: note: ‘enablegc’ was declared here
  bool enablegc;
       ^

Am I doing something wrong?

Cheers,
mwh

On 4 August 2015 at 05:55, Ian Lance Taylor <iant@golang.org> wrote:
> On Mon, Aug 3, 2015 at 2:10 AM, Andreas Schwab <schwab@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
>
> --
> You received this message because you are subscribed to the Google Groups "gofrontend-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to gofrontend-dev+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
diff mbox

Patch

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);