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

$ go version
go version go1.26-devel_f11599b0b9 Thu Jul 24 10:50:32 2025 -0700 darwin/arm64

Does this issue reproduce with the latest release?

No

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/yoshikishibata/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/yoshikishibata/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/qn/tk45rt715m19dkddkmn919240000gn/T/go-build2401287281=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/yoshikishibata/tools/go/src/go.mod'
GOMODCACHE='/Users/yoshikishibata/gocode/pkg/mod'
GONOPROXY='github.com/x-asia/*'
GONOSUMDB='github.com/x-asia/*'
GOOS='darwin'
GOPATH='/Users/yoshikishibata/gocode'
GOPRIVATE='github.com/x-asia/*'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/yoshikishibata/tools/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/yoshikishibata/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/yoshikishibata/tools/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.26-devel_f11599b0b9 Thu Jul 24 10:50:32 2025 -0700'
GOWORK=''
PKG_CONFIG='pkg-config'
GOROOT/bin/go version: go version go1.26-devel_f11599b0b9 Thu Jul 24 10:50:32 2025 -0700 darwin/arm64
uname -v: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000
ProductName:        macOS
ProductVersion:     15.5
BuildVersion:       24F74
lldb --version: lldb-1700.0.9.502
Apple Swift version 6.1.2 (swiftlang-6.1.2.1.2 clang-1700.0.13.5)

What did you do?

To rebuild the latest tip version, just run all.bash under src directory.

What did you expect to see?

No error

What did you see instead?

% ./all.bash                                                                                     [~/tools/go/src]
Building Go cmd/dist using /usr/local/go. (go1.24.5 darwin/arm64)
Building Go toolchain1 using /usr/local/go.
# bootstrap/cmd/compile/internal/ssa
../../../../src/cmd/compile/internal/ssa/looprotate.go:85: loopnest.calculateDepths undefined (type *loopnest has no field or method calculateDepths)
go tool dist: FAILED: /usr/local/go/bin/go install -tags=math_big_pure_go compiler_bootstrap purego bootstrap/cmd/...: exit status 1

Comment From: dims

5045fdd8ff cmd/compile: fix containsUnavoidableCall computation seems to be the culprit.

if i drop the commit above then it make.bash works fine.

I see the same issue on ubuntu as well.

❯ git log --oneline -1 | tee
5045fdd8ff cmd/compile: fix containsUnavoidableCall computation
❯ ./make.bash
Building Go cmd/dist using /opt/homebrew/Cellar/go/1.24.5/libexec. (go1.24.5 darwin/arm64)
Building Go toolchain1 using /opt/homebrew/Cellar/go/1.24.5/libexec.
# bootstrap/cmd/compile/internal/ssa
../../../../src/cmd/compile/internal/ssa/looprotate.go:85: loopnest.calculateDepths undefined (type *loopnest has no field or method calculateDepths)
go tool dist: FAILED: /opt/homebrew/Cellar/go/1.24.5/libexec/bin/go install -tags=math_big_pure_go compiler_bootstrap purego bootstrap/cmd/...: exit status 1
❯ git reset --hard HEAD~1
HEAD is now at d28b27cd8e go/types, types2: use nil to represent incomplete explicit aliases
❯ git log --oneline -1 | tee
d28b27cd8e go/types, types2: use nil to represent incomplete explicit aliases
❯ ./make.bash
Building Go cmd/dist using /opt/homebrew/Cellar/go/1.24.5/libexec. (go1.24.5 darwin/arm64)
Building Go toolchain1 using /opt/homebrew/Cellar/go/1.24.5/libexec.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for darwin/arm64.
---
Installed Go for darwin/arm64 in /Users/dsrinivas/go/src/github.com/golang/go
Installed commands in /Users/dsrinivas/go/src/github.com/golang/go/bin
*** You need to add /Users/dsrinivas/go/src/github.com/golang/go/bin to your PATH.

Comment From: randall77

CL 690036 fixes it.

Comment From: gopherbot

Change https://go.dev/cl/690036 mentions this issue: cmd/compile: remove no-longer-necessary call to calculateDepths

Comment From: dims

thanks @randall77 !