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 Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@shawndx
Copy link
Contributor

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 Issues related to the Go compiler and/or runtime. label Aug 3, 2022
@gopherbot
Copy link
Contributor

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

@cuonglm
Copy link
Member

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 The path to resolution is known, but the work has not been done. label Aug 3, 2022
@cuonglm cuonglm added this to the Go1.20 milestone Aug 3, 2022
@randall77
Copy link
Contributor

@gopherbot please open a backport to 1.19.

@gopherbot
Copy link
Contributor

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.

jproberts pushed a commit to jproberts/go that referenced this issue Aug 10, 2022
Same as CL 417555, but for cmd/compile.

Fixes golang#54220

Change-Id: I4cc6deaf0a87c952f636888b4ab73f81a44bfebd
Reviewed-on: https://go-review.googlesource.com/c/go/+/420975
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
@golang golang locked and limited conversation to collaborators Aug 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. 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