golang / go

The Go programming language

Home Page:https://go.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cmd/compile: internal compiler error: b3.Succs has duplicate block b3

dvyukov opened this issue · comments

on dev.ssa branch
go version devel +be2a3e2 Thu Jul 2 08:29:33 2015 +0000 linux/amd64

gc crashes on the following program:

package a
func f_ssa() {_:{_:_:}}
go.go:2: internal compiler error: b3.Succs has duplicate block b3

Are labels named _ valid go? It would seem like you can't use them ever, yet an unused label is invalid.

@griesemer for spec question

Worth checking whether it crashes the same way with named labels.

@DanielMorsing @dvyukov Labels named _ are valid. The _ identifier is a valid identifier everywhere a name is declared (as in a label declaration), but _ is never entered into a scope and thus is never defined/declared. Thus it doesn't "exist" and cannot be used or found as being unused. Very much like _ variables are valid and the compiler does not complain if they are not used.

CL https://golang.org/cl/12093 mentions this issue.

Fixed by CL 12093.