This patch to the Go compiler fixes the case of taking the address of a field of a local variable. Previously taking the address of the field was not treated as taking the address of the variable. But, of course, it is. This patch fixes the problem. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
OK for 4.7 branch? This is a real bug, bad runtime code generated for valid Go code. Ian
diff -r 784c72ffe147 go/expressions.h --- a/go/expressions.h Wed Jun 06 23:30:08 2012 -0700 +++ b/go/expressions.h Thu Jun 07 01:03:20 2012 -0700 @@ -1888,6 +1888,10 @@ do_is_addressable() const { return this->expr_->is_addressable(); } + void + do_address_taken(bool escapes) + { this->expr_->address_taken(escapes); } + tree do_get_tree(Translate_context*);