Skip to content

Commit f75b5e9

Browse files
committed
cmd/compile: fix s390x unsigned comparison constant merging rules
On s390x unsigned integer comparisons with immediates require the immediate to be an unsigned 32-bit integer. The rule was checking that the immediate was a signed 32-bit integer. This CL also adds a test for comparisons that could be turned into compare with immediate or equivalent instructions (depending on architecture and optimizations applied). Fixes #19940. Change-Id: Ifd6aa989fd3d50e282f7d30fec9db462c28422b1 Reviewed-on: https://go-review.googlesource.com/40433 Run-TryBot: Michael Munday <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: David Chase <[email protected]>
1 parent dc09a7a commit f75b5e9

File tree

5 files changed

+2474
-6
lines changed

5 files changed

+2474
-6
lines changed

src/cmd/compile/internal/gc/ssa_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ func TestArithmeticConst(t *testing.T) { runTest(t, "arithConst.go") }
6363

6464
func TestChan(t *testing.T) { runTest(t, "chan.go") }
6565

66+
// TestComparisonsConst tests results for comparison operations against constants.
67+
func TestComparisonsConst(t *testing.T) { runTest(t, "cmpConst.go") }
68+
6669
func TestCompound(t *testing.T) { runTest(t, "compound.go") }
6770

6871
func TestCtl(t *testing.T) { runTest(t, "ctl.go") }

0 commit comments

Comments
 (0)