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: range over rune literal causes internal compiler error #64471

Closed
dominikh opened this issue Nov 30, 2023 · 1 comment
Closed

cmd/compile: range over rune literal causes internal compiler error #64471

dominikh opened this issue Nov 30, 2023 · 1 comment
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@dominikh
Copy link
Member

dominikh commented Nov 30, 2023

Go version

go version devel go1.22-b4fa5b163d Thu Nov 30 13:03:03 2023 +0000 linux/amd64

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

ODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/dominikh/.cache/go-build'
GOENV='/home/dominikh/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/dominikh/prj/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/dominikh/prj'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/dominikh/prj/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/dominikh/prj/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='devel go1.22-b4fa5b163d Thu Nov 30 13:03:03 2023 +0000'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/dominikh/prj/src/example.com/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2316299034=/tmp/go-build -gno-record-gcc-switches'

What did you do?

$ cat foo.go
package main

func main() {
	for i := range 'a' {
		println(i)
	}
}

$ go build foo.go

What did you expect to see?

No ICE

What did you see instead?

# command-line-arguments
<unknown line number>: internal compiler error: assertion failed

goroutine 1 [running]:
runtime/debug.Stack()
	../../go/src/runtime/debug/stack.go:24 +0x5e
cmd/compile/internal/base.FatalfAt({0xf5f728?, 0x0?}, {0xdff80b, 0x10}, {0x0, 0x0, 0x0})
	../../go/src/cmd/compile/internal/base/print.go:225 +0x1d7
cmd/compile/internal/base.Fatalf(...)
	../../go/src/cmd/compile/internal/base/print.go:194
cmd/compile/internal/base.Assert(...)
	../../go/src/cmd/compile/internal/base/print.go:237
cmd/compile/internal/noder.assert(...)
	../../go/src/cmd/compile/internal/noder/stencil.go:15
cmd/compile/internal/noder.(*writer).expr(0xc00047bc30, {0xf63c08?, 0xc000482370?})
	../../go/src/cmd/compile/internal/noder/writer.go:1735 +0x278b
cmd/compile/internal/noder.(*writer).forStmt(0xc00047bc30, 0xc0004822d0)
	../../go/src/cmd/compile/internal/noder/writer.go:1430 +0x1b9
cmd/compile/internal/noder.(*writer).stmt1(0xc00047bc30, {0xf61870?, 0xc0004822d0})
	../../go/src/cmd/compile/internal/noder/writer.go:1289 +0x24f
cmd/compile/internal/noder.(*writer).stmts(0xc00047bc30, {0xc00004a600, 0x1, 0x0?})
	../../go/src/cmd/compile/internal/noder/writer.go:1220 +0x8e
cmd/compile/internal/noder.(*pkgWriter).bodyIdx(0xc000002180, 0xc000481b80, 0xc000481ac0, 0xc0000f60a0)
	../../go/src/cmd/compile/internal/noder/writer.go:1124 +0x186
cmd/compile/internal/noder.(*writer).funcExt(0xc00047b8c0, 0xc0004861c0)
	../../go/src/cmd/compile/internal/noder/writer.go:1059 +0x328
cmd/compile/internal/noder.(*writer).doObj(0xc00047b810, 0xc00047b8c0, {0xf679e0, 0xc0004861c0})
	../../go/src/cmd/compile/internal/noder/writer.go:819 +0x213
cmd/compile/internal/noder.(*pkgWriter).objIdx(0xc000002180, {0xf679e0, 0xc0004861c0})
	../../go/src/cmd/compile/internal/noder/writer.go:778 +0x579
cmd/compile/internal/noder.(*pkgWriter).objInstIdx(0xc000002180, {0xf679e0, 0xc0004861c0}, 0x0, 0x0)
	../../go/src/cmd/compile/internal/noder/writer.go:719 +0xf0
cmd/compile/internal/noder.(*writer).obj(...)
	../../go/src/cmd/compile/internal/noder/writer.go:695
cmd/compile/internal/noder.writePkgStub({0x0?, {0x0?, 0x0?}}, {0xc0000b03e0, 0x1, 0x1})
	../../go/src/cmd/compile/internal/noder/unified.go:317 +0x645
cmd/compile/internal/noder.unified(...)
	../../go/src/cmd/compile/internal/noder/unified.go:172
cmd/compile/internal/noder.LoadPackage({0xc0001420f0, 0x1, 0x1})
	../../go/src/cmd/compile/internal/noder/noder.go:77 +0x4d2
cmd/compile/internal/gc.Main(0xe2f510)
	../../go/src/cmd/compile/internal/gc/main.go:197 +0xbbd
main.main()
	../../go/src/cmd/compile/main.go:57 +0xf9
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Nov 30, 2023
@cuonglm cuonglm self-assigned this Nov 30, 2023
@cuonglm cuonglm added this to the Go1.22 milestone Nov 30, 2023
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/546296 mentions this issue: cmd/compile: fix typecheck range over rune literal

@dmitshur dmitshur added the NeedsFix The path to resolution is known, but the work has not been done. label Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
Status: Done
Development

No branches or pull requests

4 participants