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: internal compiler error of atomic type and offsetof #54220

Closed
shawndx opened this issue Aug 3, 2022 · 4 comments
Closed

cmd/compile: internal compiler error of atomic type and offsetof #54220

shawndx opened this issue Aug 3, 2022 · 4 comments
Assignees
Labels
compiler/runtime NeedsFix
Milestone

Comments

@shawndx
Copy link
Contributor

@shawndx shawndx commented Aug 3, 2022

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

$ go version
go version go1.19 linux/amd64

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="auto"
GOARCH="amd64"
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOOS="linux"
GOVCS=""
GOVERSION="go1.19"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
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 -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3916657495=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Try to cross-build a simple case having atomic type and unsafe.Offsetof.

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

GOARCH=386 go build <simple.go>

What did you expect to see?

no error.

What did you see instead?

command-line-arguments

./simple.go:17:44: internal compiler error: got 4 from types2, but want 8

@gopherbot gopherbot added the compiler/runtime label Aug 3, 2022
@gopherbot
Copy link

@gopherbot gopherbot commented Aug 3, 2022

Change https://go.dev/cl/420975 mentions this issue: cmd/compile: correct alignment of atomic.Int64

@cuonglm
Copy link
Member

@cuonglm cuonglm commented Aug 3, 2022

Seems we need to backport this to go1.19, since when there's no workaround.

cc @randall77 @mdempsky

@cuonglm cuonglm added the NeedsFix label Aug 3, 2022
@cuonglm cuonglm added this to the Go1.20 milestone Aug 3, 2022
@randall77
Copy link
Contributor

@randall77 randall77 commented Aug 3, 2022

@gopherbot please open a backport to 1.19.

@gopherbot
Copy link

@gopherbot gopherbot commented Aug 3, 2022

Backport issue(s) opened: #54235 (for 1.19).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime NeedsFix
Projects
Status: Done
Development

No branches or pull requests

4 participants