diff --git a/src/cmd/compile/internal/ssagen/ssa.go b/src/cmd/compile/internal/ssagen/ssa.go index 48d5e34f46..b4a55c00af 100644 --- a/src/cmd/compile/internal/ssagen/ssa.go +++ b/src/cmd/compile/internal/ssagen/ssa.go @@ -7,7 +7,6 @@ package ssagen import ( "bufio" "bytes" - "cmd/compile/internal/abi" "fmt" "go/constant" "html" @@ -17,6 +16,7 @@ import ( "sort" "strings" + "cmd/compile/internal/abi" "cmd/compile/internal/base" "cmd/compile/internal/ir" "cmd/compile/internal/liveness" @@ -3521,6 +3521,10 @@ func (s *state) append(n *ir.CallExpr, inplace bool) *ssa.Value { } } + // The following deletions have no practical effect at this time + // because state.vars has been reset by the preceding state.startBlock. + // They only enforce the fact that these variables are no longer need in + // the current scope. delete(s.vars, ptrVar) delete(s.vars, lenVar) if !inplace { @@ -6379,7 +6383,7 @@ func (s *state) dottype1(pos src.XPos, src, dst *types.Type, iface, source, targ idata := s.newValue1(ssa.OpIData, byteptr, iface) res = s.newValue2(ssa.OpIMake, dst, s.variable(typVar, byteptr), idata) resok = cond - delete(s.vars, typVar) + delete(s.vars, typVar) // no practical effect, just to indicate typVar is no longer live. return } // converting to a nonempty interface needs a runtime call. @@ -6504,12 +6508,12 @@ func (s *state) dottype1(pos src.XPos, src, dst *types.Type, iface, source, targ s.startBlock(bEnd) if tmp == nil { res = s.variable(valVar, dst) - delete(s.vars, valVar) + delete(s.vars, valVar) // no practical effect, just to indicate typVar is no longer live. } else { res = s.load(dst, addr) } resok = s.variable(okVar, types.Types[types.TBOOL]) - delete(s.vars, okVar) + delete(s.vars, okVar) // ditto return res, resok }