Commit c1a16b7d authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/compile: loop in disjoint OpOffPtr check

We collapse OpOffPtrs during generic rewrites.
However, we also use disjoint at the same time.
Instead of waiting for all OpOffPtrs to be collapsed
before the disjointness rules can kick in,
burrow through all OpOffPtrs immediately.

Change-Id: I60d0a70a9b4605b1817db7c4aab0c0d789651c90
Reviewed-on: https://go-review.googlesource.com/c/145206
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: 's avatarMichael Munday <mike.munday@ibm.com>
Reviewed-by: 's avatarKeith Randall <khr@golang.org>
parent 9fc22d29
...@@ -542,7 +542,7 @@ func disjoint(p1 *Value, n1 int64, p2 *Value, n2 int64) bool { ...@@ -542,7 +542,7 @@ func disjoint(p1 *Value, n1 int64, p2 *Value, n2 int64) bool {
} }
baseAndOffset := func(ptr *Value) (base *Value, offset int64) { baseAndOffset := func(ptr *Value) (base *Value, offset int64) {
base, offset = ptr, 0 base, offset = ptr, 0
if base.Op == OpOffPtr { for base.Op == OpOffPtr {
offset += base.AuxInt offset += base.AuxInt
base = base.Args[0] base = base.Args[0]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment