This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libgo patch committed: Remove unused variable


This patch from Peter Collingbourne removes an unused variable from
libgo.  The variable is set but never used, and gccgo was not giving an
error about such cases.  I will shortly commit a gccgo patch to detect
this case.  This patch bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

diff -r cc0233176c9b libgo/go/reflect/value.go
--- a/libgo/go/reflect/value.go	Sun Jul 20 08:12:13 2014 -0700
+++ b/libgo/go/reflect/value.go	Sun Jul 20 12:19:22 2014 -0700
@@ -434,13 +434,12 @@
 	// Get function pointer, type.
 	t := v.typ
 	var (
-		fn       unsafe.Pointer
-		rcvr     Value
-		rcvrtype *rtype
+		fn   unsafe.Pointer
+		rcvr Value
 	)
 	if v.flag&flagMethod != 0 {
 		rcvr = v
-		rcvrtype, t, fn = methodReceiver(op, v, int(v.flag)>>flagMethodShift)
+		_, t, fn = methodReceiver(op, v, int(v.flag)>>flagMethodShift)
 	} else if v.flag&flagIndir != 0 {
 		fn = *(*unsafe.Pointer)(v.ptr)
 	} else {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]