From c8caad423cafcca7c39dbaf64b428aaf0e8ac80c Mon Sep 17 00:00:00 2001 From: "Paul E. Murphy" Date: Mon, 18 Sep 2023 11:29:20 -0500 Subject: cmd/compile/internal/ssa: optimize (AND (MOVDconst [-1] x)) on PPC64 This sequence can show up in the lowering pass on PPC64. If it makes it to the latelower pass, it will cause an error because it looks like it can be turned into RLDICL, but -1 isn't an accepted mask. Also, print more debug info if panic is called from encodePPC64RotateMask. Fixes #62698 Change-Id: I0f3322e2205357abe7fc28f96e05e3f7ad65567c Reviewed-on: https://go-review.googlesource.com/c/go/+/529195 Reviewed-by: Lynn Boger Run-TryBot: Paul Murphy TryBot-Result: Gopher Robot Reviewed-by: Matthew Dempsky LUCI-TryBot-Result: Go LUCI Reviewed-by: Cherry Mui --- test/codegen/copy.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/codegen') diff --git a/test/codegen/copy.go b/test/codegen/copy.go index 4c4c857460..17ee8bc807 100644 --- a/test/codegen/copy.go +++ b/test/codegen/copy.go @@ -151,3 +151,9 @@ func ptrBothOffset() { // s390x:-"BEQ",-"BNE" copy(x[1:], x[2:]) } + +// Verify #62698 on PPC64. +func noMaskOnCopy(a []int, s string, x int) int { + // ppc64x:-"MOVD\t$-1", -"AND" + return a[x&^copy([]byte{}, s)] +} -- cgit v1.3-5-g9baa