]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: remove pointer temporaries in walkcompare
authorMatthew Dempsky <mdempsky@google.com>
Thu, 26 Sep 2019 18:00:13 +0000 (11:00 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 30 Sep 2019 23:44:36 +0000 (23:44 +0000)
commite76b9e8908bdcdb4363d6bd23aa7ff3120237426
tree8771289de278fd03b538fc25bf5e15d4afe0931b
parentecc2d6179898a3d24a8bb0a91aca6ff84ca843d8
cmd/compile: remove pointer temporaries in walkcompare

When comparing two T-typed values t1 and t2 using the T_eq function,
we used to generate:

    pl := &t1
    pr := &t2
    return T_eq(pl, pr, unsafe.Sizeof(T{}))

This CL changes it to simply generate:

    return T_eq(&t1, &t2, unsafe.Sizeof(T{}))

Surprisingly, this does not pass toolstash. For some reason, it seems
like SSA wasn't able to SSA-ify the pl and pr variables in all cases.

Change-Id: I111fbb068a1741fa169c9922cb8cdb6e21579aa4
Reviewed-on: https://go-review.googlesource.com/c/go/+/197601
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/walk.go