compiler: add break label in 1,2-case select statement lowering

Programming / Compilers / GCC - ian [138bc75d-0d04-0410-961f-82ee72b054a4] - 10 July 2019 17:56 EDT

CL 184998 added optimizations for one- and two-case select statements. But it didn't handle break statement in the select case correctly. Specifically, it didn't add the label definition, so it could result in a dangling goto. This CL fixes this, by adding the label definition.

A test case is CL 185520.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/185519

63196477131 compiler: add break label in 1,2-case select statement lowering
gcc/go/gofrontend/MERGE | 2 +-
gcc/go/gofrontend/statements.cc | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)

Upstream: gcc.gnu.org


  • Share