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

unsafe: unsafe.Alignof atomic.Int64 error #54832

Closed
richzw opened this issue Sep 2, 2022 · 1 comment
Closed

unsafe: unsafe.Alignof atomic.Int64 error #54832

richzw opened this issue Sep 2, 2022 · 1 comment

Comments

@richzw
Copy link

richzw commented Sep 2, 2022

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

$ go version
go1.19 darwin/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="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/me/Library/Caches/go-build"
GOENV="/Users/me/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/me/go/pkg/mod"
GONOPROXY="github.com/com"
GONOSUMDB="github.com/com"
GOOS="darwin"
GOPATH="/Users/me/go"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/me/go119/go1.19"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/me/go119/go1.19/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.19"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/me/go/src/test/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 -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/c9/4szs5fc14m74qknb351618k00000gn/T/go-build2731140220=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

For codes

func main() {
	var a64 atomic.Int64
	fmt.Println(unsafe.Alignof(a64))
}

With compile GOOS=linux GOARCH=386 go build tt.go

Got the output error

# command-line-arguments
./test.go:8:28: internal compiler error: got 4 from types2, but want 8

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

Is there anything am I misunderstanding or missing?

@cuonglm
Copy link
Member

cuonglm commented Sep 2, 2022

Duplicated of #54220.

@cuonglm cuonglm closed this as completed Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants