Patchwork [gccgo] Remove some write-only variables

login
register
mail settings
Submitter Ian Taylor
Date Oct. 8, 2010, 8:33 p.m.
Message ID <mcrfwwg2znm.fsf@google.com>
Download mbox | patch
Permalink /patch/67280/
State New
Headers show

Comments

Ian Taylor - Oct. 8, 2010, 8:33 p.m.
This patch removes some write-only variables in libgo, detected by
mainline gcc.  Committed to gccgo branch.

Ian

Patch

diff -r 7f20885a93b2 libgo/runtime/go-go.c
--- a/libgo/runtime/go-go.c	Fri Sep 24 17:15:07 2010 -0700
+++ b/libgo/runtime/go-go.c	Fri Oct 08 13:30:26 2010 -0700
@@ -435,8 +435,6 @@ 
   me = pthread_self ();
   for (p = __go_all_thread_ids; p != NULL; p = p->next)
     {
-      _Bool isme = 0;
-
       if (p->tentative)
 	{
 	  /* The goroutine function and argument can be allocated on
@@ -458,7 +456,6 @@ 
 
       if (pthread_equal (me, p->id))
 	{
-	  isme = 1;
 	  next_segment = NULL;
 	  next_sp = NULL;
 	  initial_sp = NULL;
@@ -485,7 +482,6 @@ 
 
       if (pthread_equal (me, p->id))
 	{
-	  isme = 1;
 	  uintptr_t top = (uintptr_t) m->gc_sp;
 	  uintptr_t bottom = (uintptr_t) &top;
 	  if (top < bottom)
diff -r 7f20885a93b2 libgo/runtime/go-unwind.c
--- a/libgo/runtime/go-unwind.c	Fri Sep 24 17:15:07 2010 -0700
+++ b/libgo/runtime/go-unwind.c	Fri Oct 08 13:30:26 2010 -0700
@@ -157,11 +157,10 @@ 
 
   __go_panic_defer->__exception = hdr;
 
-  _Unwind_Reason_Code code;
 #ifdef __USING_SJLJ_EXCEPTIONS__
-  code = _Unwind_SjLj_RaiseException (hdr);
+  _Unwind_SjLj_RaiseException (hdr);
 #else
-  code = _Unwind_RaiseException (hdr);
+  _Unwind_RaiseException (hdr);
 #endif
 
   /* Raising an exception should not return.  */