diff --git a/src/cmd/compile/internal/ssa/prove.go b/src/cmd/compile/internal/ssa/prove.go index 5195a48608..807f198787 100644 --- a/src/cmd/compile/internal/ssa/prove.go +++ b/src/cmd/compile/internal/ssa/prove.go @@ -1698,10 +1698,12 @@ func (ft *factsTable) flowLimit(v *Value) bool { b := ft.limits[v.Args[1].ID] return ft.unsignedMax(v, minU(a.umax, b.umax)) case OpOr64, OpOr32, OpOr16, OpOr8: - // OR can only make the value bigger. + // OR can only make the value bigger and can't flip bits proved to be zero in both inputs. a := ft.limits[v.Args[0].ID] b := ft.limits[v.Args[1].ID] - return ft.unsignedMin(v, maxU(a.umin, b.umin)) + return ft.unsignedMinMax(v, + maxU(a.umin, b.umin), + 1< 0xfff { // ERROR "Disproved Less64U$" + return 42 + } + } else { + if z <= 0xfff { // ERROR "Proved Leq64U$" + return 1337 + } + } + return int(z) +} + //go:noinline func useInt(a int) { }