Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: yet another "internal compiler error: second walk of switch" #29562

Closed
dr2chase opened this issue Jan 4, 2019 · 1 comment
Closed
Milestone

Comments

@dr2chase
Copy link
Contributor

dr2chase commented Jan 4, 2019

This is the result of an effort to root out all walked-a-node twice bugs.

What version of Go are you using (go version)?

go version go1.11 darwin/amd64

also tip

go version devel +23c22ca42c Fri Jan 4 05:11:30 2019 +0000 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/drchase/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/drchase/work/gocode"
GOPROXY=""
GORACE=""
GOROOT="/Users/drchase/work/go-quick"
GOTMPDIR=""
GOTOOLDIR="/Users/drchase/work/go-quick/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/gr/vvb66dqx6jl6lh8wckfd5p9w0095tn/T/go-build861431346=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

https://play.golang.org/p/0C-4ZutLsEc

Or go tool compile, with this input:

package p

func il(s string) string {
	switch len(s) {
	case 0:
		return "zero"
	case 1:
		return "one"
	}
	return s
}

func f() {
	var s string
	var as []string
	switch false && (s+"a"+as[0]+il(s)+as[0]+s == "") {
	}
}

What did you expect to see?

compilation

What did you see instead?

failure:

dwalkil.go:16:33: internal compiler error: second walk of switch
@dr2chase dr2chase added this to the Go1.12 milestone Jan 4, 2019
@dr2chase dr2chase self-assigned this Jan 4, 2019
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/156317 mentions this issue: cmd/compile: modify swt.go to avoid double walk of switch

@katiehockman katiehockman changed the title Yet another "internal compiler error: second walk of switch" cmd/compile: yet another "internal compiler error: second walk of switch" Jan 4, 2019
@golang golang locked and limited conversation to collaborators Jan 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants