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: ICE: 'NameCon': Unexpected Load as selector, leaf=v549 = IData <*uint8> v502, selector=v502 = Load <EdgeType> v289 v136 #42727

Closed
dmgk opened this issue Nov 19, 2020 · 3 comments

Comments

@dmgk
Copy link
Contributor

@dmgk dmgk commented Nov 19, 2020

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

$ go version
go version devel +5ba1c3f290 Thu Nov 19 04:02:59 2020 +0000 freebsd/amd64

Does this issue reproduce with the latest release?

No, tip only

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/dmgk/.cache/go-build"
GOENV="/home/dmgk/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOINSECURE=""
GOMODCACHE="/home/dmgk/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="freebsd"
GOPATH="/home/dmgk/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/dmgk/opt/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/dmgk/opt/go/pkg/tool/freebsd_amd64"
GOVCS=""
GOVERSION="devel +5ba1c3f290 Thu Nov 19 04:02:59 2020 +0000"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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=/tmp/go-build207921525=/tmp/go-build -gno-record-gcc-switches"
GOROOT/bin/go version: go version devel +5ba1c3f290 Thu Nov 19 04:02:59 2020 +0000 freebsd/amd64
GOROOT/bin/go tool compile -V: compile version devel +5ba1c3f290 Thu Nov 19 04:02:59 2020 +0000
uname -v: FreeBSD 12.2-STABLE r367758 XOMBO
lldb --version: lldb version 10.0.1 (git@github.com:llvm/llvm-project.git revision llvmorg-10.0.1-0-gef32c611aa2)
  clang revision llvmorg-10.0.1-0-gef32c611aa2
  llvm revision llvmorg-10.0.1-0-gef32c611aa2
gdb --version: GNU gdb (GDB) 9.2 [GDB v9.2 for FreeBSD]

What did you do?

go get github.com/MichaelMure/git-bug@0.7.1

What did you expect to see?

go get completing without errors.

What did you see instead?

$ go get github.com/MichaelMure/git-bug@0.7.1
# github.com/MichaelMure/git-bug/graphql/connections
../go/pkg/mod/github.com/!michael!mure/git-bug@v0.0.0-20200404104824-2d64b85db71a/graphql/connections/connection_template.go:46:10: internal compiler error: 'NameCon': Unexpected Load as selector, leaf=v549 = IData <*uint8> v502, selector=v502 = Load <EdgeType> v289 v136


goroutine 7 [running]:
runtime/debug.Stack(0xdb6fc0, 0xc0000c0008, 0x0)
        /home/dmgk/opt/go/src/runtime/debug/stack.go:24 +0x9f
cmd/compile/internal/gc.Fatalf(0xc00044bac0, 0x38, 0xc0006a6f30, 0x3, 0x3)
        /home/dmgk/opt/go/src/cmd/compile/internal/gc/subr.go:199 +0x1b0
cmd/compile/internal/gc.(*ssafn).Fatalf(0xc00045f320, 0x2e0a000000002, 0xcb858c, 0x32, 0xc00007b8c0, 0x2, 0x2)
        /home/dmgk/opt/go/src/cmd/compile/internal/gc/ssa.go:7105 +0x1a5
cmd/compile/internal/ssa.(*Func).Fatalf(...)
        /home/dmgk/opt/go/src/cmd/compile/internal/ssa/func.go:652
cmd/compile/internal/ssa.expandCalls.func6(0xc000838040, 0xc000836bb0, 0x8, 0xc93d09, 0x5, 0x8)
        /home/dmgk/opt/go/src/cmd/compile/internal/ssa/expand_calls.go:251 +0xf26
cmd/compile/internal/ssa.expandCalls.func6(0xc000838040, 0xc000838040, 0x0, 0x11da020, 0x0, 0x1)
        /home/dmgk/opt/go/src/cmd/compile/internal/ssa/expand_calls.go:350 +0x20f2
cmd/compile/internal/ssa.expandCalls(0xc000490840)
        /home/dmgk/opt/go/src/cmd/compile/internal/ssa/expand_calls.go:922 +0x233d
cmd/compile/internal/ssa.Compile(0xc000490840)
        /home/dmgk/opt/go/src/cmd/compile/internal/ssa/compile.go:96 +0x98d
cmd/compile/internal/gc.buildssa(0xc0004902c0, 0x2, 0x0)
        /home/dmgk/opt/go/src/cmd/compile/internal/gc/ssa.go:469 +0x11ba
cmd/compile/internal/gc.compileSSA(0xc0004902c0, 0x2)
        /home/dmgk/opt/go/src/cmd/compile/internal/gc/pgen.go:319 +0x5d
cmd/compile/internal/gc.compileFunctions.func2(0xc0003b2a80, 0xc0000b6790, 0x2)
        /home/dmgk/opt/go/src/cmd/compile/internal/gc/pgen.go:384 +0x4d
created by cmd/compile/internal/gc.compileFunctions
        /home/dmgk/opt/go/src/cmd/compile/internal/gc/pgen.go:382 +0x129
@cherrymui
Copy link
Contributor

@cherrymui cherrymui commented Nov 19, 2020

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 20, 2020

Change https://golang.org/cl/271906 mentions this issue: cmd/compile: allow loading single field of typed-interface{} OpIData

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Dec 10, 2020

Change https://golang.org/cl/276952 mentions this issue: cmd/compile: set correct type for OpIData

Loading

gopherbot pushed a commit that referenced this issue Dec 14, 2020
Since CL 270057, there're many attempts to fix the expand_calls pass
with interface{}-typed. But all of them did not fix the root cause. The
main issue is during SSA conversion in gc/ssa.go, for empty interface
case, we make its type as n.Type, instead of BytePtr.

To fix these, we can just use BytePtr for now, since when itab fields
are treated as scalar.

No significal changes on compiler speed, size.

cmd/compile/internal/ssa
expandCalls.func6 9488 -> 9232  (-2.70%)

file                       before   after    Δ       %
cmd/compile/internal/ssa.s 3992893  3992637  -256    -0.006%
total                      20500447 20500191 -256    -0.001%

Fixes #43112
Updates #42784
Updates #42727
Updates #42568

Change-Id: I0b15d9434e0be5448453e61f98ef9c2d6cd93792
Reviewed-on: https://go-review.googlesource.com/c/go/+/276952
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants