This patch by Than McIntosh fixes the length of the type of the roots array in Gogo::register_gc_vars. 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 243899) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -9a89f32811e6b3a29e22dda46e9c23811f562876 +d9be5f5d7907cbc169424fe2b8532cc3919cad5b 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 243766) +++ gcc/go/gofrontend/gogo.cc (working copy) @@ -740,9 +740,9 @@ Gogo::register_gc_vars(const std::vector "__size", uint_type); Location builtin_loc = Linemap::predeclared_location(); - Expression* length = Expression::make_integer_ul(var_gc.size(), NULL, - builtin_loc); - + unsigned roots_len = var_gc.size() + this->gc_roots_.size() + 1; + Expression* length = Expression::make_integer_ul(roots_len, NULL, + builtin_loc); Array_type* root_array_type = Type::make_array_type(root_type, length); Type* ptdt = Type::make_type_descriptor_ptr_type(); Struct_type* root_list_type =