diff --git a/src/cmd/compile/internal/ssa/sccp.go b/src/cmd/compile/internal/ssa/sccp.go index 65a62f8043..3c109548ab 100644 --- a/src/cmd/compile/internal/ssa/sccp.go +++ b/src/cmd/compile/internal/ssa/sccp.go @@ -358,8 +358,10 @@ func computeLattice(f *Func, val *Value, args ...*Value) lattice { return lattice{constant, constValue} } } - // Either we can not match generic rules for given value or it does not satisfy - // additional constraints(e.g. divide by zero) + // Either we can not match generic rules for given value or it does not + // satisfy additional constraints(e.g. divide by zero), in these cases, clean + // up temporary value immediately in case they are not dominated by their args. + constValue.reset(OpInvalid) return lattice{bottom, nil} }