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

gccgo: internal compiler error building github.com/klauspost/compress/flate #59169

Closed
kmicklas opened this issue Mar 21, 2023 · 4 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@kmicklas
Copy link

kmicklas commented Mar 21, 2023

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

$ go version
go version unknown linux/amd64

This is a source build of gccgo from GCC 12.2.

Does this issue reproduce with the latest release?

This is the latest release of gccgo. The issue does not reproduce with gc.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/kmicklas/.cache/go-build"
GOENV="/home/kmicklas/.config/go/env"
GOEXE=""
GOEXPERIMENT="fieldtrack,regabiwrappers"
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/kmicklas/go/pkg/mod"
GOOS="linux"
GOPATH="/home/kmicklas/go"
GOROOT="/opt/bb/lib/gcc-12.2"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/bb/lib/gcc-12.2/libexec/gcc/x86_64-unknown-linux-gnu/12.2.0"
GOVCS=""
GOVERSION="unknown"
GCCGO="/opt/bb/lib/gcc-12.2/bin/gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/kmicklas/compress/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 -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2289663056=/tmp/go-build -gno-record-gcc-switches -funwind-tables"

What did you do?

Clone https://github.com/klauspost/compress/tree/7633d627f0ca03e4e9e3f718b44f3328720a0167. Run

go build -compiler gccgo ./flate

What did you expect to see?

It would build successfully, as it does with gc.

What did you see instead?

# github.com/klauspost/compress/flate
go1: internal compiler error: in do_get_backend, at go/gofrontend/expressions.cc:13792
0x665c7d Array_index_expression::do_get_backend(Translate_context*)
        ../../gcc/go/gofrontend/expressions.cc:13792
0x6d2ff0 Set_and_use_temporary_expression::do_get_backend(Translate_context*)
        ../../gcc/go/gofrontend/expressions.cc:1332
0x6d3284 Slice_info_expression::do_get_backend(Translate_context*)
        ../../gcc/go/gofrontend/expressions.cc:18295
0x6d2ff0 Set_and_use_temporary_expression::do_get_backend(Translate_context*)
        ../../gcc/go/gofrontend/expressions.cc:1332
0x763d52 Temporary_statement::do_get_backend(Translate_context*)
        ../../gcc/go/gofrontend/statements.cc:632
0x722db3 Block::get_backend(Translate_context*)
        ../../gcc/go/gofrontend/gogo.cc:7104
0x75f7e2 If_statement::do_get_backend(Translate_context*)
        ../../gcc/go/gofrontend/statements.cc:3808
0x722db3 Block::get_backend(Translate_context*)
        ../../gcc/go/gofrontend/gogo.cc:7104
0x75e92c Block_statement::do_get_backend(Translate_context*)
        ../../gcc/go/gofrontend/statements.cc:2231
0x722db3 Block::get_backend(Translate_context*)
        ../../gcc/go/gofrontend/gogo.cc:7104
0x7238cf Function::build(Gogo*, Named_object*)
        ../../gcc/go/gofrontend/gogo.cc:6639
0x72d634 Gogo::write_globals()
        ../../gcc/go/gofrontend/gogo.cc:1595
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
@gopherbot gopherbot added this to the Gccgo milestone Mar 21, 2023
@heschi
Copy link
Contributor

heschi commented Mar 21, 2023

cc @ianlancetaylor @thanm

@heschi heschi added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 21, 2023
@ianlancetaylor
Copy link
Contributor

Reduced test case:

package p

func F(p *[]byte) {
	*(*[1]byte)(*p) = *(*[1]byte)((*p)[1:])
}

@gopherbot
Copy link

Change https://go.dev/cl/478217 mentions this issue: test: add test that caused gofrontend crash

@gopherbot
Copy link

Change https://go.dev/cl/478176 mentions this issue: compiler: add missing Slice_info_expression::do_traverse

gopherbot pushed a commit that referenced this issue Mar 22, 2023
For #59169

Change-Id: Id72ad9fe8b6e1d7cf64f972520ae8858f70c025a
Reviewed-on: https://go-review.googlesource.com/c/go/+/478217
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
@golang golang locked and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants