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

Semi-regular merge from tip to dev.ssa.

Two fixes:
1) Mark selectgo as not returning.  This caused problems
   because there are no VARKILL ops on the selectgo path,
   causing things to be marked live that shouldn't be.
2) Tell the amd64 assembler that addressing modes like
   name(SP)(AX*4) are ok.

Change-Id: I9ca81c76391b1a65cc47edc8610c70ff1a621913
diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go
index 35a4929..3f8fdce 100644
--- a/src/cmd/compile/internal/gc/ssa.go
+++ b/src/cmd/compile/internal/gc/ssa.go
@@ -544,7 +544,8 @@
 	// Expression statements
 	case OCALLFUNC, OCALLMETH, OCALLINTER:
 		s.call(n, callNormal)
-		if n.Op == OCALLFUNC && n.Left.Op == ONAME && n.Left.Class == PFUNC && n.Left.Sym.Pkg == Runtimepkg && n.Left.Sym.Name == "gopanic" {
+		if n.Op == OCALLFUNC && n.Left.Op == ONAME && n.Left.Class == PFUNC && n.Left.Sym.Pkg == Runtimepkg &&
+			(n.Left.Sym.Name == "gopanic" || n.Left.Sym.Name == "selectgo") {
 			m := s.mem()
 			b := s.endBlock()
 			b.Kind = ssa.BlockExit
@@ -873,6 +874,10 @@
 			lab.breakTarget = nil
 		}
 
+		// OSWITCH never falls through (s.curBlock == nil here).
+		// OSELECT does not fall through if we're calling selectgo.
+		// OSELECT does fall through if we're calling selectnb{send,recv}[2].
+		// In those latter cases, go to the code after the select.
 		if b := s.endBlock(); b != nil {
 			b.AddEdgeTo(bEnd)
 		}