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

h8liu/golang,h8liu/golang,h8liu/golang,h8liu/golang,h8liu/golang,h8liu/golang,h8liu/golang