Skip to content

cmd/compile: internal compiler error: unknown op in select ASOP #57641

@jeremybobbin

Description

@jeremybobbin

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

$ go version
go version go1.19.4 linux/amd64

Does this issue reproduce with the latest release?

Yes.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/founder/.cache/go-build"
GOENV="/home/founder/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/founder/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/founder/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.19"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.19/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19.4"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/founder/mvd/go.mod"
GOWORK=""
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 -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1143537869=/tmp/go-build -gno-record-gcc-switches"

What did you do?

The project I'm working on is proprietary unfortunately & my laptop is about to die so you won't be getting a minimum viable bug replication today. :(
However, I believe this is the bit that caused the compiler error:

        total := func() int64 {
                var total int64
                var dones int
                for {
                        select {
                        case total += <-sizes:
                        case <-done:
                                dones += 1
                                if dones == len(o) {
                                        return total
                                }
                        }
                }

        }()

What did you expect to see?

I was expecting to see a type error or syntax related error, or maybe even no compilation errors at all!!

What did you see instead?

It asks me to "Please file a bug report including a short program that triggers the error."
Not sure if this is supposed to make my code compile?

Compiling the (proprietary) project results in:

# mvd
select case
.   ASOP-ADD AsOp:ADD tc(1) # overlay.go:158:15,overlay.go:167:3
.   .   NAME-main.total esc(no) Class:PAUTO Offset:0 InlLocal OnStack Used int64 tc(1) # overlay.go:154:7,overlay.go:167:3
.   .   RECV int64 tc(1) # overlay.go:158:18,overlay.go:167:3
.   .   .   NAME-main.sizes esc(no) Class:PAUTO Offset:0 Byval OnStack CHAN-chan int64 tc(1) # overlay.go:133:2
./overlay.go:167:3: internal compiler error: unknown op in select ASOP

Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions