compiler: avoid GCC middle-end control warnings
commit8ac0f7677f9a317c9dee0168313fc411b3745f78
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 2 Dec 2017 00:38:54 +0000 (2 00:38 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 2 Dec 2017 00:38:54 +0000 (2 00:38 +0000)
tree8d0aee02a39a2db4df11c4755923b7677cdae58a
parentdc75b246913c77d85231262e1ab5f3d9cdabd6ed
compiler: avoid GCC middle-end control warnings

    GCC has started emitting "control reaches end of non-void function"
    warnings. Avoid them 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.

    Fixes golang/go#22767

    Reviewed-on: https://go-review.googlesource.com/80416

* go-gcc.cc (Gcc_backend::Gcc_backend): Define
__builtin_unreachable.
(Gcc_backend::function): Add does_not_return parameter.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255346 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/ChangeLog
gcc/go/go-gcc.cc
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/backend.h
gcc/go/gofrontend/gogo.cc
gcc/go/gofrontend/runtime.def
gcc/go/gofrontend/statements.cc