golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.98k stars 17.67k forks source link

cmd/compile: GOEXPERIMENT=unified <autogenerated>:1: internal compiler error: missing wrapper #52128

Closed andig closed 2 years ago

andig commented 2 years ago

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

$ go version
go version go1.18 darwin/arm64

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="arm64"
GOBIN=""
GOCACHE="/Users/andig/Library/Caches/go-build"
GOENV="/Users/andig/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/andig/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/andig/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/Cellar/go/1.18/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.18/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/andig/htdocs/evcc/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 -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/sv/rs_453y57xj86xsbz3kw1mbc0000gn/T/go-build3960792540=/tmp/go-build -gno-record-gcc-switches -fno-common"
GOROOT/bin/go version: go version go1.18 darwin/arm64
GOROOT/bin/go tool compile -V: compile version go1.18
uname -v: Darwin Kernel Version 21.4.0: Mon Feb 21 20:36:53 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T8101
ProductName:    macOS
ProductVersion: 12.3
BuildVersion:   21E230
lldb --version: lldb-1316.0.9.41
Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)

What did you do?

GOEXPERIMENT=unified go run main.go charger

on https://github.com/evcc-io/evcc/commit/0420779115f960abc437a60683fd3cf2817814a4

What did you expect to see?

No compiler error

What did you see instead?

# github.com/evcc-io/evcc/vehicle/vag/service
<autogenerated>:1: internal compiler error: missing wrapper for Refresh

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

CC @mdempsky

andig commented 2 years ago

This also fails on tip but has a stack trace there:

goroutine 1 [running]:
runtime/debug.Stack()
    /Users/andig/sdk/gotip/src/runtime/debug/stack.go:24 +0x64
cmd/compile/internal/base.FatalfAt({0x772690?, 0x140?}, {0x10564c3f9, 0x16}, {0x140007e2e38, 0x1, 0x1})
    /Users/andig/sdk/gotip/src/cmd/compile/internal/base/print.go:227 +0x224
cmd/compile/internal/walk.methodValueWrapper(0x14000a81e00)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/closure.go:231 +0x148
cmd/compile/internal/walk.walkMethodValue(0x14000a81e00, 0x140007e36d0)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/closure.go:191 +0x350
cmd/compile/internal/walk.walkExpr1({0x1058716a8, 0x14000a81e00}, 0x14000a81e00?)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:320 +0xd4c
cmd/compile/internal/walk.walkExpr({0x1058716a8, 0x14000a81e00}, 0x140007e36d0)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:55 +0x370
cmd/compile/internal/walk.walkConv(0x14000c1efa0, 0x1050520c8?)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/convert.go:23 +0x3c
cmd/compile/internal/walk.walkExpr1({0x105870340, 0x14000c1efa0}, 0x14000c1efa0?)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:219 +0x570
cmd/compile/internal/walk.walkExpr({0x105870340, 0x14000c1efa0}, 0x140007e36d0)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:55 +0x370
cmd/compile/internal/walk.walkAssign(0x140007e36d0, {0x10586fb58, 0x14000c64e10?})
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/assign.go:72 +0x8c8
cmd/compile/internal/walk.walkExpr1({0x10586fb58, 0x14000c64e10}, 0x14000c64e10?)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:179 +0x3e0
cmd/compile/internal/walk.walkExpr({0x10586fb58, 0x14000c64e10}, 0x140007e36d0)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:55 +0x370
cmd/compile/internal/walk.appendWalkStmt(0x140007e36d0, {0x10586fb58, 0x14000c64e10})
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/walk.go:256 +0x64
cmd/compile/internal/walk.ascompatee(0x15, {0x14000bfde00?, 0x2, 0x2?}, {0x14000bfde60?, 0x2, 0x0?})
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/assign.go:372 +0x55c
cmd/compile/internal/walk.walkAssignList(0x140007e3a70, 0x14000a81f20)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/assign.go:146 +0x128
cmd/compile/internal/walk.walkExpr1({0x10586f9e8, 0x14000a81f20}, 0x14000a81f20?)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:183 +0x2ec
cmd/compile/internal/walk.walkExpr({0x10586f9e8, 0x14000a81f20}, 0x140007e3a70)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:55 +0x370
cmd/compile/internal/walk.walkStmt({0x10586f9e8, 0x14000a81f20?})
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/stmt.go:57 +0x6ac
cmd/compile/internal/walk.walkStmtList(...)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/stmt.go:175
cmd/compile/internal/walk.Walk(0x14000c18b40)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/walk.go:43 +0x194
cmd/compile/internal/gc.prepareFunc(0x14000c18b40)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/gc/compile.go:92 +0x80
cmd/compile/internal/gc.enqueueFunc(0x14000c18b40)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/gc/compile.go:66 +0x29c
cmd/compile/internal/gc.Main(0x105868700)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/gc/main.go:295 +0x1044
main.main()
    /Users/andig/sdk/gotip/src/cmd/compile/main.go:55 +0xf4
gopherbot commented 2 years ago

Change https://go.dev/cl/407855 mentions this issue: cmd/compile: fix missing method value wrapper in unified IR

gopherbot commented 2 years ago

Change https://go.dev/cl/410339 mentions this issue: [dev.unified] cmd/compile: fix missing method value wrapper in unified IR

gopherbot commented 2 years ago

Change https://go.dev/cl/410344 mentions this issue: [dev.unified] cmd/compile: fix missing method value wrapper in unified IR

ianlancetaylor commented 2 years ago

@mdempsky Is there anything else to do for this issue? It's currently in the 1.19 milestone. Thanks.

andig commented 2 years ago

Current Go1.19 still shows same error- not sure if this is expected?

cuonglm commented 2 years ago

Current Go1.19 still shows same error- not sure if this is expected?

Should be fixed on tip with Unified IR enabled. Could you please try it?

andig commented 2 years ago

I'm afraid not:

GOEXPERIMENT=unified gotip run main.go charger
# github.com/evcc-io/evcc/vehicle/vag/service
<autogenerated>:1: internal compiler error: missing wrapper for Refresh

goroutine 1 [running]:
runtime/debug.Stack()
    /Users/andig/sdk/gotip/src/runtime/debug/stack.go:24 +0x64
cmd/compile/internal/base.FatalfAt({0x816c40?, 0x140?}, {0x10555e153, 0x16}, {0x1400058eca8, 0x1, 0x1})
    /Users/andig/sdk/gotip/src/cmd/compile/internal/base/print.go:227 +0x224
cmd/compile/internal/walk.methodValueWrapper(0x14000b10540)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/closure.go:231 +0x14c
cmd/compile/internal/walk.walkMethodValue(0x14000b10540, 0x1400058f530)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/closure.go:191 +0x31c
cmd/compile/internal/walk.walkExpr1({0x105792b08, 0x14000b10540}, 0x14000b10540?)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:321 +0xad0
cmd/compile/internal/walk.walkExpr({0x105792b08, 0x14000b10540}, 0x1400058f530)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:56 +0x370
cmd/compile/internal/walk.walkConv(0x14000b1e320, 0x104f353d8?)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/convert.go:23 +0x3c
cmd/compile/internal/walk.walkExpr1({0x1057917a0, 0x14000b1e320}, 0x14000b1e320?)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:220 +0x450
cmd/compile/internal/walk.walkExpr({0x1057917a0, 0x14000b1e320}, 0x1400058f530)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:56 +0x370
cmd/compile/internal/walk.walkAssign(0x1400058f530, {0x105790fb8, 0x14000b6c190?})
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/assign.go:72 +0x8cc
cmd/compile/internal/walk.walkExpr1({0x105790fb8, 0x14000b6c190}, 0x14000b6c190?)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:180 +0x32c
cmd/compile/internal/walk.walkExpr({0x105790fb8, 0x14000b6c190}, 0x1400058f530)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:56 +0x370
cmd/compile/internal/walk.appendWalkStmt(0x1400058f530, {0x105790fb8, 0x14000b6c190})
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/walk.go:256 +0x64
cmd/compile/internal/walk.ascompatee(0x15, {0x14000b22100?, 0x2, 0x2?}, {0x14000b22160?, 0x2, 0x0?})
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/assign.go:374 +0x560
cmd/compile/internal/walk.walkAssignList(0x1400058f8d0, 0x14000b10660)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/assign.go:146 +0x128
cmd/compile/internal/walk.walkExpr1({0x105790e48, 0x14000b10660}, 0x14000b10660?)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:184 +0x260
cmd/compile/internal/walk.walkExpr({0x105790e48, 0x14000b10660}, 0x1400058f8d0)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:56 +0x370
cmd/compile/internal/walk.walkStmt({0x105790e48, 0x14000b10660?})
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/stmt.go:58 +0x6c8
cmd/compile/internal/walk.walkStmtList(...)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/stmt.go:177
cmd/compile/internal/walk.Walk(0x14000afb680)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/walk/walk.go:43 +0x194
cmd/compile/internal/gc.prepareFunc(0x14000afb680)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/gc/compile.go:92 +0x80
cmd/compile/internal/gc.enqueueFunc(0x14000afb680)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/gc/compile.go:66 +0x29c
cmd/compile/internal/gc.Main(0x105786d20)
    /Users/andig/sdk/gotip/src/cmd/compile/internal/gc/main.go:300 +0x10f8
main.main()
    /Users/andig/sdk/gotip/src/cmd/compile/main.go:57 +0xf4

with

gotip version
go version devel go1.20-29b9a32 Tue Aug 2 18:52:33 2022 +0000 darwin/arm64
cuonglm commented 2 years ago

@andig Thanks for confirmation.

~Checkout at a8780f94c3eb19dda8aaa15ad83468b2d54a0e5a build the repo ok, so seems to be regression somewhere.~

Ops, I forgot that we need to wait dev.unified branch to be merged to master for testing on tip. In the meantime, you should checkout dev.unified branch and test it.