This patch by Chris Manghane changes the Go frontend to not make a GC symbol for an invalid array type. This avoids a compiler crash and fixes https://golang.org/issue/11539 . Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 226795) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -55175f7ee0db2c1e68423216d7744be80071ed6c +5fc38e74d132cd6f4e7b56e6bcf9fe57031ab203 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: gcc/go/gofrontend/types.cc =================================================================== --- gcc/go/gofrontend/types.cc (revision 226510) +++ gcc/go/gofrontend/types.cc (working copy) @@ -6423,7 +6423,10 @@ Array_type::array_gc_symbol(Gogo* gogo, unsigned long bound; if (!this->length_->numeric_constant_value(&nc) || nc.to_unsigned_long(&bound) == Numeric_constant::NC_UL_NOTINT) - go_assert(saw_errors()); + { + go_assert(saw_errors()); + return; + } Btype* pbtype = gogo->backend()->pointer_type(gogo->backend()->void_type()); int64_t pwidth = gogo->backend()->type_size(pbtype);