cmd/gc: racewalk: do not double function calls Current racewalk transformation looks like: x := <-makeChan().c \/\/\/\/\/\/\/\/\/ runtime.raceread(&makeChan().c) x := <-makeChan().c and so makeChan() is called twice. With this CL the transformation looks like: x := <-makeChan().c \/\/\/\/\/\/\/\/\/ chan *tmp = &(makeChan().c) raceread(&*tmp) x := <-(*tmp) Fixes issue 4245.
cmd/gc: racewalk: do not double function calls
Current racewalk transformation looks like:
x := <-makeChan().c
\/\/\/\/\/\/\/\/\/
runtime.raceread(&makeChan().c)
x := <-makeChan().c
and so makeChan() is called twice.
With this CL the transformation looks like:
x := <-makeChan().c
\/\/\/\/\/\/\/\/\/
chan *tmp = &(makeChan().c)
raceread(&*tmp)
x := <-(*tmp)
Fixes issue 4245.

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/6822075

dsriram/golang,dsriram/golang,pombredanne/go-deleteme,tv42/old-go,tv42/old-go,gnanderson/go,gnanderson/go,apparentlymart/golang,tv42/old-go,pombredanne/go-deleteme,dsriram/golang,pombredanne/go-deleteme,apparentlymart/golang,gnanderson/go,tv42/old-go,tv42/old-go,dsriram/golang,dsriram/golang,gnanderson/go,pombredanne/go-deleteme,apparentlymart/golang,apparentlymart/golang,pombredanne/go-deleteme,apparentlymart/golang,gnanderson/go,apparentlymart/golang,tv42/old-go,pombredanne/go-deleteme,gnanderson/go,tv42/old-go,pombredanne/go-deleteme,dsriram/golang,dsriram/golang,gnanderson/go,apparentlymart/golang