Skip to content

cmd/compile: Pow10 freeze the compiler on certain condition on Go 1.24 #71852

Closed
@etrnal70

Description

@etrnal70

Go version

go version go1.24.0 darwin/arm64

Output of go env in your module/workspace:

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/hanifrmn/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/hanifrmn/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/xd/37pvgts12bg_bk2wx9kp9gbm0000gp/T/go-build2186527099=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/hanifrmn/Repo/playground/go.mod'
GOMODCACHE='/Users/hanifrmn/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/hanifrmn/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/hanifrmn/sdk/go1.24.0'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/hanifrmn/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/hanifrmn/sdk/go1.24.0/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.24.0'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

package main

import (
	"math"
)

func main() {
	test(2)
}

func test(i int) {
	if i <= 0 {
		return
	}

	_ = math.Pow10(i + 2)
}

running go build will freeze the compiler

What did you see happen?

Running go build will freeze the compiler

Running with -gcflags=-l rans fine

What did you expect to see?

It compiles correctly on Go 1.23.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.CriticalA critical problem that affects the availability or correctness of production systems built using GoFixPendingIssues that have a fix which has not yet been reviewed or submitted.ImplementationIssues describing a semantics-preserving change to the Go implementation.NeedsFixThe path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions