Skip to content

cmd/compile, cmd/link: drop support for IntSize != PtrSize #19954

@mdempsky

Description

@mdempsky

TL;DR: Do we anticipate ever supporting architectures with IntSize != PtrSize again? (Note: This is different from supporting PtrSize != RegSize architectures like amd64p32.)

The Go spec allows int and pointers to be independently sized, and for Go 1.0, amd64 had 64-bit pointers but 32-bit ints. However, since Go 1.1, all supported architectures have had identically sized ints and pointers.

There's still vestigial code within the toolchain to support IntSize != PtrSize architectures, but it's not always used correctly. For example, ssa/gen/dec.rules and gc.(*ssafn).SplitSlice both calculate the cap field's offset as 2*Widthptr, when it should be Widthptr+Widthint. ld.textsectionmap assumes IntSize==PtrSize by using IntSize to populate uintptr fields.

I'm inclined to remove all the Int-named variables and just use the Ptr-named ones everywhere. As precedence, runtime/internal/sys only has PtrSize and RegSize, and go/types.StdSizes only has WordSize (with the same meaning as PtrSize).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions