From 7b67b68a0da091be2d7dc3e69c4df9a1a080d0de Mon Sep 17 00:00:00 2001 From: Jorropo Date: Thu, 4 Dec 2025 04:17:58 +0100 Subject: cmd/compile: use isUnsignedPowerOfTwo rather than isPowerOfTwo for unsigneds Fixes #76688 Change-Id: Icb8dab54a5ce7d83b656d50d5ea605d2a62b96f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/726680 Auto-Submit: Jorropo LUCI-TryBot-Result: Go LUCI Reviewed-by: Cuong Manh Le Reviewed-by: Keith Randall Reviewed-by: Keith Randall Reviewed-by: Dmitri Shuralyov --- test/prove.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/prove.go b/test/prove.go index 1b50317fe3..e04b510e17 100644 --- a/test/prove.go +++ b/test/prove.go @@ -2718,6 +2718,14 @@ func detectStringLenRelation(s string) bool { return false } +func issue76688(x, y uint64) uint64 { + if x > 1 || y != 1<<63 { + return 42 + } + // We do not want to rewrite the multiply to a condselect here since opt can do a better job with a left shift. + return x * y +} + //go:noinline func prove(x int) { } -- cgit v1.3-6-g1900