Skip to content

cmd/compile: fix broken regalloc eviction of AVX-512 K mask values on amd64 #81767

Closed as duplicate

Description

@9muir

Go version

go version go1.28-devel_8190b02cec linux/amd64

Output of go env in your module/workspace:

AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN='/usr/local/google/home/sjmuir/go/bin'
GOCACHE='/usr/local/google/home/sjmuir/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/usr/local/google/home/sjmuir/.config/go/env'
GOEXE=''
GOEXPERIMENT='simd'
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2210645409=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE='/usr/local/google/home/sjmuir/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPACKAGESDRIVER=''
GOPATH='/usr/local/google/home/sjmuir/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/google/home/sjmuir/go/git/go-tip'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/usr/local/google/home/sjmuir/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/google/home/sjmuir/go/git/go-tip/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.28-devel_8190b02cec Thu Sep 24 15:49:11 2026 -0700'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

Attempting to generate a version of bytes.IndexByte by using the SIMD API, got very ambitious with loop unrolling and decided that 8-way unrolling would be desirable. This worked great in earlier versions of Go, but when rebasing the change onto tip we found out that 8-way unrolling causes a compiler panic.

What did you see happen?

Compiler panic due to spilling >7 K mask registers on AMD64.

Program that reproduces the bug: https://go.dev/play/p/kLfBd5L1DAS

What did you expect to see?

Compiler not panicking.

potential fix CL

Activity

  1. gopherbot commented on Sep 26, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/838845 mentions this issue: cmd/compile: fix regalloc eviction of AVX-512 K mask values on amd64

  2. added
    NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.
    on Sep 29, 2026
  3. prattmic commented on Sep 29, 2026

    @prattmic
    Member

    cc @golang/compiler

  4. added
    FixPendingIssues that have a fix which has not yet been reviewed or submitted.
    on Sep 29, 2026
  5. 9muir commented on Oct 7, 2026

    @9muir
    ContributorAuthor

    This is duplicated by #81976, and the fix there is sufficient

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

FixPendingIssues that have a fix which has not yet been reviewed or submitted.NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.compiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions