aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/gc/ssa.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/gc/ssa.go')
-rw-r--r--src/cmd/compile/internal/gc/ssa.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go
index c8fb013ad0..89644cd3f2 100644
--- a/src/cmd/compile/internal/gc/ssa.go
+++ b/src/cmd/compile/internal/gc/ssa.go
@@ -295,7 +295,10 @@ func (s *state) emitOpenDeferInfo() {
// worker indicates which of the backend workers is doing the processing.
func buildssa(fn *Node, worker int) *ssa.Func {
name := fn.funcname()
- printssa := name == ssaDump
+ printssa := false
+ if ssaDump != "" { // match either a simple name e.g. "(*Reader).Reset", or a package.name e.g. "compress/gzip.(*Reader).Reset"
+ printssa = name == ssaDump || myimportpath+"."+name == ssaDump
+ }
var astBuf *bytes.Buffer
if printssa {
astBuf = &bytes.Buffer{}
@@ -2110,7 +2113,7 @@ func (s *state) expr(n *Node) *ssa.Value {
}
// unsafe.Pointer <--> *T
- if to.Etype == TUNSAFEPTR && from.IsPtrShaped() || from.Etype == TUNSAFEPTR && to.IsPtrShaped() {
+ if to.IsUnsafePtr() && from.IsPtrShaped() || from.IsUnsafePtr() && to.IsPtrShaped() {
return v
}
@@ -6179,7 +6182,7 @@ func genssa(f *ssa.Func, pp *Progs) {
// Resolve branches, and relax DefaultStmt into NotStmt
for _, br := range s.Branches {
- br.P.To.Val = s.bstart[br.B.ID]
+ br.P.To.SetTarget(s.bstart[br.B.ID])
if br.P.Pos.IsStmt() != src.PosIsStmt {
br.P.Pos = br.P.Pos.WithNotStmt()
} else if v0 := br.B.FirstPossibleStmtValue(); v0 != nil && v0.Pos.Line() == br.P.Pos.Line() && v0.Pos.IsStmt() == src.PosIsStmt {