Skip to content

ppc64: codegen tests (constants.go, mathbits.go) are eliminated by dead-code removal unless results escape #75768

@jkrishmys

Description

@jkrishmys

Go version

go version go1.26-devel_2a71af11fc linux/ppc64le

Output of go env in your module/workspace:

GOARCH='linux/ppc64le'

What did you do?

Ran codegen tests at tip:
../bin/go test cmd/internal/testdir -run='Test/codegen/constants.go' -v -count=1
../bin/go test cmd/internal/testdir -run='Test/codegen/mathbits.go' -v -count=1

What did you see happen?

codegen/constants.go:12: linux/ppc64le/power10: opcode not found: "^MOVD\t[$]8193,"
codegen/constants.go:18: linux/ppc64le/power10: opcode not found: "^SLD\t[$]44,"
codegen/mathbits.go:741: linux/ppc64le/power10: opcode not found: "^ADDC\tR\d+,"
codegen/mathbits.go:743: linux/ppc64le/power10: opcode not found: "^ADDE"

What did you expect to see?

Expected the compiler to emit the expected PPC64 instructions matching the ppc64x: asm comments. Disassembly confirms that both shifted16BitConstants and contiguousMaskConstants, as well as Add64MultipleChains, were reduced to a single JMP LR because the results were not observable.

Metadata

Metadata

Assignees

Labels

BugReportIssues describing a possible bug in the Go implementation.arch-ppc64x

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions