The GCC middle-end has started emitting "control reaches end of non-void function" warnings. This are not too useful for Go, which implements its own error for this in the frontend. Avoid the middle-end warnings for Go by 1) marking the builtin function panic and the compiler-generated function __go_runtime_error as not returning and 2) adding a default case to the switch used for select statements that simply calls __builtin_unreachable. This fixes https://golang.org/issue/22767. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian 2017-12-01 Ian Lance Taylor * go-gcc.cc (Gcc_backend::Gcc_backend): Define __builtin_unreachable. (Gcc_backend::function): Add does_not_return parameter.