[dev.ssa] Merge remote-tracking branch 'origin/master' into mergebranch

Semi-regular merge of master into dev.ssa.

Change-Id: I48aa17700096a14f2a20ad07491ebfcd7529f6d5
diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go
index a554a1d..96d6204 100644
--- a/src/cmd/compile/internal/gc/ssa.go
+++ b/src/cmd/compile/internal/gc/ssa.go
@@ -455,7 +455,7 @@
 			return
 		}
 		if compiling_runtime != 0 {
-			Fatal("%v escapes to heap, not allowed in runtime.", n)
+			Fatalf("%v escapes to heap, not allowed in runtime.", n)
 		}
 
 		// TODO: the old pass hides the details of PHEAP
@@ -1783,7 +1783,7 @@
 			// Rewrite to an OCALLFUNC: (p.f)(...) becomes (f)(p, ...)
 			// Take care not to modify the original AST.
 			if left.Op != ODOTMETH {
-				Fatal("OCALLMETH: n.Left not an ODOTMETH: %v", left)
+				Fatalf("OCALLMETH: n.Left not an ODOTMETH: %v", left)
 			}
 
 			newLeft := *left.Right
@@ -2675,7 +2675,7 @@
 	if f.StaticData != nil {
 		for _, n := range f.StaticData.([]*Node) {
 			if !gen_as_init(n, false) {
-				Fatal("non-static data marked as static: %v\n\n", n, f)
+				Fatalf("non-static data marked as static: %v\n\n", n, f)
 			}
 		}
 	}
@@ -3468,7 +3468,7 @@
 		}
 	case ssa.BlockExit:
 	case ssa.BlockRet:
-		if Hasdefer != 0 {
+		if hasdefer {
 			s.deferReturn()
 		}
 		Prog(obj.ARET)
@@ -3780,7 +3780,7 @@
 func (e *ssaExport) Fatalf(msg string, args ...interface{}) {
 	// If e was marked as unimplemented, anything could happen. Ignore.
 	if !e.unimplemented {
-		Fatal(msg, args...)
+		Fatalf(msg, args...)
 	}
 }
 
@@ -3788,7 +3788,7 @@
 // It will be removed once SSA work is complete.
 func (e *ssaExport) Unimplementedf(msg string, args ...interface{}) {
 	if e.mustImplement {
-		Fatal(msg, args...)
+		Fatalf(msg, args...)
 	}
 	const alwaysLog = false // enable to calculate top unimplemented features
 	if !e.unimplemented && (e.log || alwaysLog) {