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: compiler crash on valid code #52241

Closed
Apakhov opened this issue Apr 8, 2022 · 5 comments
Closed

cmd/compile: compiler crash on valid code #52241

Apakhov opened this issue Apr 8, 2022 · 5 comments
Labels
NeedsInvestigation release-blocker
Milestone

Comments

@Apakhov
Copy link

@Apakhov Apakhov commented Apr 8, 2022

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

$ go version
go version go1.18 darwin/amd64

also reproduces on https://go.dev/play/

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="/Users/apakhov/Library/Caches/go-build"
GOENV="/Users/apakhov/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/apakhov/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/apakhov/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.18/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.18/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
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 -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/f7/27f7jd_n39sgk_j5kdmll529rw8xry/T/go-build3996695027=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

https://go.dev/play/p/w45g1myrZTl

What did you expect to see?

compilation success

What did you see instead?

:1: internal compiler error: unexpected dot in identifier: .rcvr1

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

Go build failed.
@ianlancetaylor ianlancetaylor changed the title affected/package: internal compiler error cmd/compile: compiler crash on valid code Apr 8, 2022
@ianlancetaylor ianlancetaylor added NeedsInvestigation release-blocker labels Apr 8, 2022
@ianlancetaylor ianlancetaylor added this to the Go1.19 milestone Apr 8, 2022
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Apr 8, 2022

@gopherbot Please open backport to 1.18

This is a compiler crash on valid code.

@gopherbot
Copy link

@gopherbot gopherbot commented Apr 8, 2022

Backport issue(s) opened: #52242 (for 1.18).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Apr 8, 2022

CC @randall77 @mdempsky

@gopherbot
Copy link

@gopherbot gopherbot commented May 5, 2022

Change https://go.dev/cl/404314 mentions this issue: cmd/compile: allow exporting .rcvr ident

@wdvxdr1123
Copy link
Contributor

@wdvxdr1123 wdvxdr1123 commented May 6, 2022

A smaller repro:

package main

type Collector[T any] struct {
}

func (c *Collector[T]) Collect() {
}

func TestInOrderIntTree() {
	collector := Collector[int]{}
	_ = collector.Collect
}

func main() {
	TestInOrderIntTree()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants