Skip to content

cmd/compile: ICE with 1.18 program that succeeds with 1.18rc1 #51828

@bradenaw

Description

@bradenaw

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

$ go version
go version go1.18 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/bw/.cache/go-build"
GOENV="/home/bw/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/bw/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/bw/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/bw/src/bergamot/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1251825903=/tmp/go-build -gno-record-gcc-switches"

What did you do?

go build ./... in https://github.com/bradenaw/bergamot a2e31c7e340800f186e9d382644399305f90e5b2

What did you expect to see?

Build succeeds, like with 1.18rc1:

  11:00:17 bw@Falcon ~/src/bergamot main
  ~> /home/bw/src/goroot/bin/go version
go version go1.18rc1 linux/amd64

  11:00:26 bw@Falcon ~/src/bergamot main
  ~> /home/bw/src/goroot/bin/go build ./...

  11:00:30 bw@Falcon ~/src/bergamot main
  ~>

What did you see instead?

~> go build ./...
# github.com/bradenaw/bergamot
<autogenerated>:1: internal compiler error: assigning node (type *xlist.Node["".kvPair[uint8,"".vAndRef[int]]]) to parameter xlist.node (type *xlist.Node[go.shape.struct { "".k uint8; "".v struct { "".v int; "".ref uint32 } }_0])

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

The project is about 1000 lines of code. I can work on a smaller reproduction if that's helpful. Unfortunately the compiler error is not particularly insightful, since it's marked <autogenerated>:1. The right type definition looks to my untrained eyes like the expansion of the left.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions