diff --git a/src/cmd/compile/internal/ssa/rewrite.go b/src/cmd/compile/internal/ssa/rewrite.go index 4197b0da88..60509d214e 100644 --- a/src/cmd/compile/internal/ssa/rewrite.go +++ b/src/cmd/compile/internal/ssa/rewrite.go @@ -204,6 +204,9 @@ func uaddOvf(a, b int64) bool { // isSamePtr reports whether p1 and p2 point to the same address. func isSamePtr(p1, p2 *Value) bool { + if p1 == p2 { + return true + } // Aux isn't used in OffPtr, and AuxInt isn't currently used in // Addr, but this still works as the values will be null/0 return (p1.Op == OpOffPtr || p1.Op == OpAddr) && p1.Op == p2.Op &&