]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: recognize more memory runs in generated algs
authorJosh Bleecher Snyder <josharian@gmail.com>
Mon, 22 Feb 2016 05:12:36 +0000 (21:12 -0800)
committerJosh Bleecher Snyder <josharian@gmail.com>
Fri, 26 Feb 2016 22:18:30 +0000 (22:18 +0000)
commit92bf58c2381acac3929d495cee596df61491af48
tree2fa444f50df36c1343136ed54d494889ffa30c4c
parent0f5d78f6784a728c3544282faebdcf5689d478ef
cmd/compile: recognize more memory runs in generated algs

The old implementation assumed that all memory runs
were terminated by non-memory fields.
This isn't necessarily so.
They might be terminated by padding or blank fields.

For example, given

type T struct {
a int64
b byte
c, d, e int64
}

the old implementation did a memory comparison on a+b, on c, and on d+e.

Instead, check for memory runs at the beginning of every round.
This now generates a memory comparison on a+b and on c+d+e.

Also, delete some now-dead code.

Change-Id: I66bffb111420adf6919bd708e4fb3a1e1f07fadd
Reviewed-on: https://go-review.googlesource.com/19841
Reviewed-by: David Crawshaw <crawshaw@golang.org>
src/cmd/compile/internal/gc/subr.go