This patch by Than McIntosh fixes a bug in the Go frontend: in Gogo::write_globals in a couple of places the wrong Bfunction was being used for the containing (not target) function when creating calls for init functions. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline.
Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 249156) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -c4ecdd3edb9febe72b5527481ae3d7310105ca67 +be5fa26b2b1b5d0755bc1c7ce25f3aa26bea9d9c The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: gcc/go/gofrontend/gogo.cc =================================================================== --- gcc/go/gofrontend/gogo.cc (revision 249125) +++ gcc/go/gofrontend/gogo.cc (working copy) @@ -1504,10 +1504,10 @@ Gogo::write_globals() Bfunction* initfn = func->get_or_make_decl(this, *p); Bexpression* func_code = this->backend()->function_code_expression(initfn, func_loc); - Bexpression* call = this->backend()->call_expression(initfn, func_code, + Bexpression* call = this->backend()->call_expression(init_bfn, func_code, empty_args, NULL, func_loc); - Bstatement* ist = this->backend()->expression_statement(initfn, call); + Bstatement* ist = this->backend()->expression_statement(init_bfn, call); init_stmts.push_back(ist); }