Skip to content

go/types: incorrect alignment of sync/atomic.Int64 and Uint64 #53884

@aclements

Description

@aclements

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

$ go version
go version devel go1.19-266c70c263 Thu Jul 14 15:54:36 2022 +0000 linux/amd64

Does this issue reproduce with the latest release?

No.

What did you do?

go/types doesn't understand the special alignment of the sync/atomic.Int64 and sync/atomic.Uint64 types that were added in this development cycle (ffe48e0, #47141).

What did you expect to see?

go/types and the gc compiler should agree on the layout of structs that include fields of these types. These fields should always be 8-byte aligned.

What did you see instead?

On 32-bit platforms, sync/atomic.Int64 and Uint64 fields are 4-byte aligned according to go/types.

I have a CL fixing this that I'll send out shortly.

/cc @rsc @griesemer

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions