This patch from Chris Manghane avoids a compiler crash for some kinds of invalid code. This is http://golang.org/issue/11592 . 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 226009) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -5c49a77455f52ba2c7eddb5b831456dc1c67b02f +b4a932b4a51b612cadcec93a83f94d6ee7d7d190 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: gcc/go/gofrontend/expressions.cc =================================================================== --- gcc/go/gofrontend/expressions.cc (revision 226007) +++ gcc/go/gofrontend/expressions.cc (working copy) @@ -3955,6 +3955,8 @@ Unary_expression::do_check_types(Gogo*) // Indirecting through a pointer. if (type->points_to() == NULL) this->report_error(_("expected pointer")); + if (type->points_to()->is_error()) + this->set_is_error(); break; default: