Skip to content

<unknown line number>: internal compiler error: assertion failed #66245

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

Closed
kambahr opened this issue Mar 11, 2024 · 1 comment
Closed

<unknown line number>: internal compiler error: assertion failed #66245

kambahr opened this issue Mar 11, 2024 · 1 comment

Comments

@kambahr
Copy link

kambahr commented Mar 11, 2024

Go version

go version go1.22.0 linux/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='<$HOME dir>/.cache/go-build'
GOENV='<$HOME dir>/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='<$HOME dir>/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='<$HOME dir>/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.22.0'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='<project path>/go.mod'
GOWORK='<project path/go.work'
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-build274260474=/tmp/go-build -gno-record-gcc-switches'

What did you do?

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

package main

func foo() {

// The following "return" statement causes a compiler error:
// CLOSURE [maing.go:18:5:var x int]
// <unknown line number>: internal compiler error: assertion failed.
return

x := 0

lblxAgain:

println("Hello World")

if x > 2 {
	return
}
x++
goto lblxAgain

}

func main() {
foo()
}

What did you see happen?

CLOSURE [.../maing.go:16:5:var x int]
: internal compiler error: assertion failed

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

What did you expect to see?

Hello World
Hello World
Hello World
Hello World

@ALTree
Copy link
Member

ALTree commented Mar 11, 2024

Thanks for reporting this. I believe this is a dup of #65593 which is already fixed on tip and approved for backporting to 1.22.

Closing as a dup.

@ALTree ALTree closed this as not planned Won't fix, can't repro, duplicate, stale Mar 11, 2024
@golang golang locked and limited conversation to collaborators Mar 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants