This patch by Ben Shi fixes the Go frontend to avoid crashing when handling a recursive type definition like
type T0 T1; type T1 T2; ...... type Tn T0 This fixes https://golang.org/issue/25320. 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 268230) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -d67c4bf0c42b79d54925ba8c5f23278ee6c3efb6 +5ccb2d8593963e06ec3a35d362b384e82301d9f0 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 268158) +++ gcc/go/gofrontend/types.cc (working copy) @@ -10259,6 +10259,15 @@ Find_type_use::type(Type* type) break; case Type::TYPE_NAMED: + if (type->named_type() == type->base()->named_type()) + { + this->found_ = true; + return TRAVERSE_EXIT; + } + else + go_assert(saw_errors()); + break; + case Type::TYPE_FORWARD: go_assert(saw_errors()); break;