Skip to content

Commit 51f508b

Browse files
mundaymbroady
authored andcommitted
[release-branch.go1.8] 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). Cherry-pick of CL 40433 and CL 40873. Fixes #19940. Reviewed-on: https://go-review.googlesource.com/40931 Reviewed-by: Brad Fitzpatrick <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Change-Id: I3daaeaa40d7637bd4421e6b8d37ea4ffd74448ce Reviewed-on: https://go-review.googlesource.com/43994 Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 243dee1 commit 51f508b

File tree

5 files changed

+2474
-6
lines changed

5 files changed

+2474
-6
lines changed

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

Lines changed: 3 additions & 0 deletions
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)