From: Josh Bleecher Snyder Date: Sun, 11 Sep 2016 15:29:04 +0000 (-0700) Subject: cmd/compile: add more non-returning runtime calls X-Git-Tag: go1.8beta1~1377 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=62ba15a492a5a26fce70aab5f44cac4a841b956e;p=gostls13.git cmd/compile: add more non-returning runtime calls This list now matches the one in popt.go. Change-Id: Ib24de531cc35252f0ef276e5c6d247654b021533 Reviewed-on: https://go-review.googlesource.com/28965 Run-TryBot: Josh Bleecher Snyder TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index 549259aff8..e2814685ff 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -585,16 +585,17 @@ func (s *state) stmt(n *Node) { case OCALLMETH, OCALLINTER: s.call(n, callNormal) - if n.Op == OCALLFUNC && n.Left.Op == ONAME && n.Left.Class == PFUNC && - (compiling_runtime && n.Left.Sym.Name == "throw" || - n.Left.Sym.Pkg == Runtimepkg && (n.Left.Sym.Name == "gopanic" || n.Left.Sym.Name == "selectgo" || n.Left.Sym.Name == "block")) { - m := s.mem() - b := s.endBlock() - b.Kind = ssa.BlockExit - b.SetControl(m) - // TODO: never rewrite OPANIC to OCALLFUNC in the - // first place. Need to wait until all backends - // go through SSA. + if n.Op == OCALLFUNC && n.Left.Op == ONAME && n.Left.Class == PFUNC { + if fn := n.Left.Sym.Name; compiling_runtime && fn == "throw" || + n.Left.Sym.Pkg == Runtimepkg && (fn == "throwinit" || fn == "gopanic" || fn == "panicwrap" || fn == "selectgo" || fn == "block") { + m := s.mem() + b := s.endBlock() + b.Kind = ssa.BlockExit + b.SetControl(m) + // TODO: never rewrite OPANIC to OCALLFUNC in the + // first place. Need to wait until all backends + // go through SSA. + } } case ODEFER: s.call(n.Left, callDefer)