Skip to content
Permalink
Browse files

Merge "Merge branch 'dev.ssa' into mergebranch"

  • Loading branch information
Gerrit Code Review
Gerrit Code Review committed Mar 1, 2016
2 parents 998aaf8 + 9d854fd commit a6fb2aede7c8d47b4d913eb83fa45bbeca76c433
Showing with 69,628 additions and 207 deletions.
  1. +3 −0 src/cmd/asm/internal/asm/operand_test.go
  2. +14 −0 src/cmd/asm/internal/asm/testdata/amd64.s
  3. +2 −1 src/cmd/asm/internal/asm/testdata/amd64error.s
  4. +1 −0 src/cmd/cgo/out.go
  5. +2 −0 src/cmd/compile/internal/amd64/prog.go
  6. +1 −0 src/cmd/compile/internal/gc/closure.go
  7. +1 −0 src/cmd/compile/internal/gc/fmt.go
  8. +3 −1 src/cmd/compile/internal/gc/gen.go
  9. +10 −1 src/cmd/compile/internal/gc/go.go
  10. +14 −1 src/cmd/compile/internal/gc/gsubr.go
  11. +15 −16 src/cmd/compile/internal/gc/init.go
  12. +22 −1 src/cmd/compile/internal/gc/lex.go
  13. +4 −0 src/cmd/compile/internal/gc/opnames.go
  14. +1 −0 src/cmd/compile/internal/gc/order.go
  15. +20 −0 src/cmd/compile/internal/gc/pgen.go
  16. +13 −5 src/cmd/compile/internal/gc/plive.go
  17. +2 −2 src/cmd/compile/internal/gc/racewalk.go
  18. +1 −2 src/cmd/compile/internal/gc/reflect.go
  19. +23 −13 src/cmd/compile/internal/gc/sinit.go
  20. +5,235 −0 src/cmd/compile/internal/gc/ssa.go
  21. +99 −0 src/cmd/compile/internal/gc/ssa_test.go
  22. +1 −1 src/cmd/compile/internal/gc/syntax.go
  23. +216 −0 src/cmd/compile/internal/gc/testdata/addressed_ssa.go
  24. +70 −0 src/cmd/compile/internal/gc/testdata/append_ssa.go
  25. +735 −0 src/cmd/compile/internal/gc/testdata/arithBoundary_ssa.go
  26. +12,671 −0 src/cmd/compile/internal/gc/testdata/arithConst_ssa.go
  27. +438 −0 src/cmd/compile/internal/gc/testdata/arith_ssa.go
  28. +142 −0 src/cmd/compile/internal/gc/testdata/array_ssa.go
  29. +147 −0 src/cmd/compile/internal/gc/testdata/assert_ssa.go
  30. +255 −0 src/cmd/compile/internal/gc/testdata/break_ssa.go
  31. +73 −0 src/cmd/compile/internal/gc/testdata/chan_ssa.go
  32. +38 −0 src/cmd/compile/internal/gc/testdata/closure_ssa.go
  33. +48 −0 src/cmd/compile/internal/gc/testdata/cmp_ssa.go
  34. +145 −0 src/cmd/compile/internal/gc/testdata/compound_ssa.go
  35. +726 −0 src/cmd/compile/internal/gc/testdata/copy_ssa.go
  36. +161 −0 src/cmd/compile/internal/gc/testdata/ctl_ssa.go
  37. +17 −0 src/cmd/compile/internal/gc/testdata/deferNoReturn_ssa.go
  38. +1,741 −0 src/cmd/compile/internal/gc/testdata/fp_ssa.go
  39. +214 −0 src/cmd/compile/internal/gc/testdata/gen/arithBoundaryGen.go
  40. +294 −0 src/cmd/compile/internal/gc/testdata/gen/arithConstGen.go
  41. +93 −0 src/cmd/compile/internal/gc/testdata/gen/copyGen.go
  42. +88 −0 src/cmd/compile/internal/gc/testdata/gen/zeroGen.go
  43. +117 −0 src/cmd/compile/internal/gc/testdata/loadstore_ssa.go
  44. +45 −0 src/cmd/compile/internal/gc/testdata/map_ssa.go
  45. +103 −0 src/cmd/compile/internal/gc/testdata/phi_ssa.go
  46. +57 −0 src/cmd/compile/internal/gc/testdata/regalloc_ssa.go
  47. +60 −0 src/cmd/compile/internal/gc/testdata/short_ssa.go
  48. +161 −0 src/cmd/compile/internal/gc/testdata/string_ssa.go
  49. +148 −0 src/cmd/compile/internal/gc/testdata/unsafe_ssa.go
  50. +563 −0 src/cmd/compile/internal/gc/testdata/zero_ssa.go
  51. +388 −0 src/cmd/compile/internal/gc/type.go
  52. +1 −1 src/cmd/compile/internal/gc/walk.go
  53. +68 −0 src/cmd/compile/internal/ssa/TODO
  54. +118 −0 src/cmd/compile/internal/ssa/block.go
  55. +291 −0 src/cmd/compile/internal/ssa/check.go
  56. +261 −0 src/cmd/compile/internal/ssa/compile.go
  57. +235 −0 src/cmd/compile/internal/ssa/config.go
  58. +60 −0 src/cmd/compile/internal/ssa/copyelim.go
  59. +39 −0 src/cmd/compile/internal/ssa/critical.go
  60. +304 −0 src/cmd/compile/internal/ssa/cse.go
  61. +123 −0 src/cmd/compile/internal/ssa/cse_test.go
  62. +270 −0 src/cmd/compile/internal/ssa/deadcode.go
  63. +134 −0 src/cmd/compile/internal/ssa/deadcode_test.go
  64. +116 −0 src/cmd/compile/internal/ssa/deadstore.go
  65. +97 −0 src/cmd/compile/internal/ssa/deadstore_test.go
  66. +261 −0 src/cmd/compile/internal/ssa/decompose.go
  67. +367 −0 src/cmd/compile/internal/ssa/dom.go
  68. +422 −0 src/cmd/compile/internal/ssa/dom_test.go
  69. +67 −0 src/cmd/compile/internal/ssa/export_test.go
  70. +131 −0 src/cmd/compile/internal/ssa/flagalloc.go
  71. +352 −0 src/cmd/compile/internal/ssa/func.go
  72. +445 −0 src/cmd/compile/internal/ssa/func_test.go
  73. +158 −0 src/cmd/compile/internal/ssa/fuse.go
  74. +129 −0 src/cmd/compile/internal/ssa/fuse_test.go
  75. +1,164 −0 src/cmd/compile/internal/ssa/gen/AMD64.rules
  76. +535 −0 src/cmd/compile/internal/ssa/gen/AMD64Ops.go
  77. +7 −0 src/cmd/compile/internal/ssa/gen/README
  78. +740 −0 src/cmd/compile/internal/ssa/gen/generic.rules
  79. +416 −0 src/cmd/compile/internal/ssa/gen/genericOps.go
  80. +262 −0 src/cmd/compile/internal/ssa/gen/main.go
  81. +630 −0 src/cmd/compile/internal/ssa/gen/rulegen.go
  82. +478 −0 src/cmd/compile/internal/ssa/html.go
  83. +28 −0 src/cmd/compile/internal/ssa/id.go
  84. +102 −0 src/cmd/compile/internal/ssa/layout.go
  85. +300 −0 src/cmd/compile/internal/ssa/likelyadjust.go
  86. +38 −0 src/cmd/compile/internal/ssa/location.go
  87. +34 −0 src/cmd/compile/internal/ssa/lower.go
  88. +260 −0 src/cmd/compile/internal/ssa/magic.go
  89. +163 −0 src/cmd/compile/internal/ssa/nilcheck.go
  90. +433 −0 src/cmd/compile/internal/ssa/nilcheck_test.go
  91. +118 −0 src/cmd/compile/internal/ssa/op.go
  92. +5,264 −0 src/cmd/compile/internal/ssa/opGen.go
  93. +10 −0 src/cmd/compile/internal/ssa/opt.go
  94. +101 −0 src/cmd/compile/internal/ssa/passbm_test.go
  95. +68 −0 src/cmd/compile/internal/ssa/phielim.go
  96. +86 −0 src/cmd/compile/internal/ssa/phiopt.go
  97. +149 −0 src/cmd/compile/internal/ssa/print.go
  98. +351 −0 src/cmd/compile/internal/ssa/prove.go
  99. +1,658 −0 src/cmd/compile/internal/ssa/regalloc.go
  100. +33 −0 src/cmd/compile/internal/ssa/regalloc_test.go
  101. +261 −0 src/cmd/compile/internal/ssa/rewrite.go
  102. +15,394 −0 src/cmd/compile/internal/ssa/rewriteAMD64.go
  103. +102 −0 src/cmd/compile/internal/ssa/rewrite_test.go
  104. +7,936 −0 src/cmd/compile/internal/ssa/rewritegeneric.go
  105. +195 −0 src/cmd/compile/internal/ssa/schedule.go
  106. +57 −0 src/cmd/compile/internal/ssa/schedule_test.go
  107. +48 −0 src/cmd/compile/internal/ssa/shift_test.go
  108. +144 −0 src/cmd/compile/internal/ssa/shortcircuit.go
  109. +50 −0 src/cmd/compile/internal/ssa/shortcircuit_test.go
  110. +69 −0 src/cmd/compile/internal/ssa/sparsemap.go
  111. +79 −0 src/cmd/compile/internal/ssa/sparseset.go
  112. +129 −0 src/cmd/compile/internal/ssa/sparsetree.go
  113. +321 −0 src/cmd/compile/internal/ssa/stackalloc.go
  114. +88 −0 src/cmd/compile/internal/ssa/tighten.go
  115. +37 −0 src/cmd/compile/internal/ssa/trim.go
  116. +131 −0 src/cmd/compile/internal/ssa/type.go
  117. +100 −0 src/cmd/compile/internal/ssa/type_test.go
  118. +259 −0 src/cmd/compile/internal/ssa/value.go
  119. +90 −0 src/cmd/compile/internal/ssa/zcse.go
  120. +2 −0 src/cmd/compile/internal/x86/prog.go
  121. +1 −0 src/cmd/dist/buildtool.go
  122. +3 −3 src/cmd/internal/obj/link.go
  123. +19 −10 src/cmd/internal/obj/obj.go
  124. +0 −1 src/cmd/internal/obj/pass.go
  125. +3 −0 src/cmd/internal/obj/util.go
  126. +22 −16 src/cmd/internal/obj/x86/a.out.go
  127. +28 −5 src/cmd/internal/obj/x86/asm6.go
  128. +20 −17 src/cmd/internal/obj/x86/obj6.go
  129. +2 −2 src/cmd/internal/obj/x86/obj6_test.go
  130. +2 −2 src/crypto/x509/sec1_test.go
  131. +4 −3 src/runtime/mgc.go
  132. +15 −1 src/runtime/race_amd64.s
  133. +0 −7 src/runtime/runtime-gdb_test.go
  134. +16 −0 test/fixedbugs/issue12347.go
  135. +36 −36 test/goto.go
  136. +5 −2 test/label.go
  137. +27 −5 test/label1.go
  138. +1 −0 test/live.go
  139. +1 −0 test/live2.go
  140. +49 −49 test/nilcheck.go
  141. +1 −1 test/nilptr3.go
  142. +209 −0 test/nilptr3_ssa.go
  143. +3 −2 test/nosplit.go
  144. +85 −0 test/opt_branchlikely.go
  145. +43 −0 test/phiopt.go
  146. +207 −0 test/prove.go
  147. +15 −0 test/run.go
  148. +1 −0 test/sliceopt.go
@@ -127,6 +127,9 @@ var amd64OperandTests = []operandTest{
{"(SI)(BX*1)", "(SI)(BX*1)"},
{"(SI)(DX*1)", "(SI)(DX*1)"},
{"(SP)", "(SP)"},
{"(SP)(AX*4)", "(SP)(AX*4)"},
{"32(SP)(BX*2)", "32(SP)(BX*2)"},
{"32323(SP)(R8*4)", "32323(SP)(R8*4)"},
{"+3(PC)", "3(PC)"},
{"-1(DI)(BX*1)", "-1(DI)(BX*1)"},
{"-3(PC)", "-3(PC)"},
@@ -127,5 +127,19 @@ loop:
MOVNTDQ X1, (AX) // MOVNTO X1, (AX)
MOVOA (AX), X1 // MOVO (AX), X1

// Tests for SP indexed addresses.
MOVQ foo(SP)(AX*1), BX // 488b1c04
MOVQ foo+32(SP)(CX*2), DX // 488b544c20
MOVQ foo+32323(SP)(R8*4), R9 // 4e8b8c84437e0000
MOVL foo(SP)(SI*8), DI // 8b3cf4
MOVL foo+32(SP)(R10*1), R11 // 468b5c1420
MOVL foo+32323(SP)(R12*2), R13 // 468bac64437e0000
MOVW foo(SP)(AX*4), R8 // 66448b0484
MOVW foo+32(SP)(R9*8), CX // 66428b4ccc20
MOVW foo+32323(SP)(AX*1), DX // 668b9404437e0000
MOVB foo(SP)(AX*2), AL // 8a0444
MOVB foo+32(SP)(CX*4), AH // 8a648c20
MOVB foo+32323(SP)(CX*8), R9 // 448a8ccc437e0000

// LTYPE0 nonnon { outcode($1, &$2); }
RET // c3
@@ -3,5 +3,6 @@
// license that can be found in the LICENSE file.

TEXT errors(SB),$0
MOVL foo<>(SB)(AX), AX // ERROR "invalid instruction"
MOVL foo<>(SB)(AX), AX // ERROR "invalid instruction"
MOVL (AX)(SP*1), AX // ERROR "invalid instruction"
RET
@@ -458,6 +458,7 @@ func (p *Package) writeDefsFunc(fgo2 io.Writer, n *Name) {
}

fmt.Fprint(fgo2, "\n")
fmt.Fprint(fgo2, "//go:cgo_unsafe_args\n")
conf.Fprint(fgo2, fset, d)
fmt.Fprint(fgo2, " {\n")

@@ -117,6 +117,7 @@ var progtable = [x86.ALAST]obj.ProgInfo{
x86.AJPL: {Flags: gc.Cjmp | gc.UseCarry},
x86.AJPS: {Flags: gc.Cjmp | gc.UseCarry},
obj.AJMP: {Flags: gc.Jump | gc.Break | gc.KillCarry},
x86.ALEAW: {Flags: gc.LeftAddr | gc.RightWrite},
x86.ALEAL: {Flags: gc.LeftAddr | gc.RightWrite},
x86.ALEAQ: {Flags: gc.LeftAddr | gc.RightWrite},
x86.AMOVBLSX: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv},
@@ -167,6 +168,7 @@ var progtable = [x86.ALAST]obj.ProgInfo{
x86.AORW: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry},
x86.APOPQ: {Flags: gc.SizeQ | gc.RightWrite},
x86.APUSHQ: {Flags: gc.SizeQ | gc.LeftRead},
x86.APXOR: {Flags: gc.SizeD | gc.LeftRead | RightRdwr},
x86.ARCLB: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry},
x86.ARCLL: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry},
x86.ARCLQ: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry},
@@ -588,6 +588,7 @@ func makepartialcall(fn *Node, t0 *Type, meth *Node) *Node {
ptr.Ullman = 1
ptr.Used = true
ptr.Name.Curfn = xfunc
ptr.Xoffset = 0
xfunc.Func.Dcl = append(xfunc.Func.Dcl, ptr)
var body []*Node
if Isptr[rcvrtype.Etype] || Isinter(rcvrtype) {
@@ -403,6 +403,7 @@ var etnames = []string{
TFORW: "FORW",
TFIELD: "FIELD",
TSTRING: "STRING",
TUNSAFEPTR: "TUNSAFEPTR",
TANY: "ANY",
}

@@ -142,6 +142,8 @@ func newlab(n *Node) *Label {
return lab
}

// There is a copy of checkgoto in the new SSA backend.
// Please keep them in sync.
func checkgoto(from *Node, to *Node) {
if from.Sym == to.Sym {
return
@@ -840,7 +842,7 @@ func gen(n *Node) {
cgen_dcl(n.Left)

case OAS:
if gen_as_init(n) {
if gen_as_init(n, false) {
break
}
Cgen_as(n.Left, n.Right)
@@ -131,7 +131,7 @@ type Type struct {
Note *string // literal string annotation

// TARRAY
Bound int64 // negative is dynamic array
Bound int64 // negative is slice

// TMAP
Bucket *Type // internal type representing a hash bucket
@@ -759,4 +759,13 @@ var Panicindex *Node

var panicslice *Node

var panicdivide *Node

var throwreturn *Node

var growslice *Node

var writebarrierptr *Node
var typedmemmove *Node

var panicdottype *Node
@@ -530,6 +530,16 @@ func newplist() *obj.Plist {
return pl
}

// nodarg does something that depends on the value of
// fp (this was previously completely undocumented).
//
// fp=1 corresponds to input args
// fp=0 corresponds to output args
// fp=-1 is a special case of output args for a
// specific call from walk that previously (and
// incorrectly) passed a 1; the behavior is exactly
// the same as it is for 1, except that PARAMOUT is
// generated instead of PARAM.
func nodarg(t *Type, fp int) *Node {
var n *Node

@@ -555,7 +565,7 @@ func nodarg(t *Type, fp int) *Node {
Fatalf("nodarg: not field %v", t)
}

if fp == 1 {
if fp == 1 || fp == -1 {
for _, n := range Curfn.Func.Dcl {
if (n.Class == PPARAM || n.Class == PPARAMOUT) && !isblanksym(t.Sym) && n.Sym == t.Sym {
return n
@@ -592,6 +602,9 @@ fp:
case 1: // input arg
n.Class = PPARAM

case -1: // output arg from paramstoheap
n.Class = PPARAMOUT

case 2: // offset output arg
Fatalf("shouldn't be used")
}
@@ -33,10 +33,10 @@ func renameinit() *Sym {
// hand-craft the following initialization code
// var initdone· uint8 (1)
// func init() (2)
// if initdone· != 0 { (3)
// if initdone· == 2 (4)
// return
// throw(); (5)
// if initdone· > 1 { (3)
// return (3a)
// if initdone· == 1 { (4)
// throw(); (4a)
// }
// initdone· = 1; (6)
// // over all matching imported symbols
@@ -118,22 +118,21 @@ func fninit(n *NodeList) {

// (3)
a := Nod(OIF, nil, nil)

a.Left = Nod(ONE, gatevar, Nodintconst(0))
a.Left = Nod(OGT, gatevar, Nodintconst(1))
a.Likely = 1
r = append(r, a)
// (3a)
a.Nbody.Set([]*Node{Nod(ORETURN, nil, nil)})

// (4)
b := Nod(OIF, nil, nil)

b.Left = Nod(OEQ, gatevar, Nodintconst(2))
b.Nbody.Set([]*Node{Nod(ORETURN, nil, nil)})
a.Nbody.Set([]*Node{b})

// (5)
b = syslook("throwinit", 0)

b = Nod(OCALL, b, nil)
a.Nbody.Append(b)
b.Left = Nod(OEQ, gatevar, Nodintconst(1))
// this actually isn't likely, but code layout is better
// like this: no JMP needed after the call.
b.Likely = 1
r = append(r, b)
// (4a)
b.Nbody.Set([]*Node{Nod(OCALL, syslook("throwinit", 0), nil)})

// (6)
a = Nod(OAS, gatevar, Nodintconst(1))
@@ -7,6 +7,7 @@
package gc

import (
"cmd/compile/internal/ssa"
"cmd/internal/obj"
"flag"
"fmt"
@@ -286,6 +287,23 @@ func Main() {
}
}
}
// special case for ssa for now
if strings.HasPrefix(name, "ssa/") {
// expect form ssa/phase/flag
// e.g. -d=ssa/generic_cse/time
// _ in phase name also matches space
phase := name[4:]
flag := "debug" // default flag is debug
if i := strings.Index(phase, "/"); i >= 0 {
flag = phase[i+1:]
phase = phase[:i]
}
err := ssa.PhaseOption(phase, flag, val)
if err != "" {
log.Fatalf(err)
}
continue Split
}
log.Fatalf("unknown debug key -d %s\n", name)
}
}
@@ -844,7 +862,7 @@ func plan9quote(s string) string {
return s
}

type Pragma uint8
type Pragma uint16

const (
Nointerface Pragma = 1 << iota
@@ -855,6 +873,7 @@ const (
Systemstack // func must run on system stack
Nowritebarrier // emit compiler error instead of write barrier
Nowritebarrierrec // error on write barrier in this or recursive callees
CgoUnsafeArgs // treat a pointer to one arg as a pointer to them all
)

type lexer struct {
@@ -1677,6 +1696,8 @@ func (l *lexer) getlinepragma() rune {
Yyerror("//go:nowritebarrierrec only allowed in runtime")
}
l.pragma |= Nowritebarrierrec | Nowritebarrier // implies Nowritebarrier
case "go:cgo_unsafe_args":
l.pragma |= CgoUnsafeArgs
}
return c
}
@@ -160,5 +160,9 @@ var opnames = []string{
OLROT: "LROT",
ORROTC: "RROTC",
ORETJMP: "RETJMP",
OPS: "OPS",
OPC: "OPC",
OSQRT: "OSQRT",
OGETG: "OGETG",
OEND: "END",
}
@@ -230,6 +230,7 @@ func cleantempnopop(mark ordermarker, order *Order, out *[]*Node) {
n := order.temp[i]
if n.Name.Keepalive {
n.Name.Keepalive = false
n.Addrtaken = true // ensure SSA keeps the n variable
kill = Nod(OVARLIVE, n, nil)
typecheck(&kill, Etop)
*out = append(*out, kill)
@@ -5,6 +5,7 @@
package gc

import (
"cmd/compile/internal/ssa"
"cmd/internal/obj"
"crypto/md5"
"fmt"
@@ -341,7 +342,12 @@ func compile(fn *Node) {
Deferreturn = Sysfunc("deferreturn")
Panicindex = Sysfunc("panicindex")
panicslice = Sysfunc("panicslice")
panicdivide = Sysfunc("panicdivide")
throwreturn = Sysfunc("throwreturn")
growslice = Sysfunc("growslice")
writebarrierptr = Sysfunc("writebarrierptr")
typedmemmove = Sysfunc("typedmemmove")
panicdottype = Sysfunc("panicdottype")
}

lno := setlineno(fn)
@@ -358,6 +364,7 @@ func compile(fn *Node) {
var nam *Node
var gcargs *Sym
var gclocals *Sym
var ssafn *ssa.Func
if len(fn.Nbody.Slice()) == 0 {
if pure_go != 0 || strings.HasPrefix(fn.Func.Nname.Sym.Name, "init.") {
Yyerror("missing function body for %q", fn.Func.Nname.Sym.Name)
@@ -409,6 +416,11 @@ func compile(fn *Node) {
goto ret
}

// Build an SSA backend function.
if shouldssa(Curfn) {
ssafn = buildssa(Curfn)
}

continpc = nil
breakpc = nil

@@ -471,6 +483,14 @@ func compile(fn *Node) {
}
}

if ssafn != nil {
genssa(ssafn, ptxt, gcargs, gclocals)
if Curfn.Func.Endlineno != 0 {
lineno = Curfn.Func.Endlineno
}
ssafn.Free()
return
}
Genslice(Curfn.Func.Enter.Slice())
Genslice(Curfn.Nbody.Slice())
gclean()
@@ -19,6 +19,7 @@ import (
"cmd/internal/obj"
"fmt"
"sort"
"strings"
)

const (
@@ -410,7 +411,7 @@ func newcfg(firstp *obj.Prog) []*BasicBlock {

bb := newblock(firstp)
cfg = append(cfg, bb)
for p := firstp; p != nil; p = p.Link {
for p := firstp; p != nil && p.As != obj.AEND; p = p.Link {
Thearch.Proginfo(p)
if p.To.Type == obj.TYPE_BRANCH {
if p.To.Val == nil {
@@ -438,7 +439,7 @@ func newcfg(firstp *obj.Prog) []*BasicBlock {
// contained instructions until a label is reached. Add edges
// for branches and fall-through instructions.
for _, bb := range cfg {
for p := bb.last; p != nil; p = p.Link {
for p := bb.last; p != nil && p.As != obj.AEND; p = p.Link {
if p.Opt != nil && p != bb.last {
break
}
@@ -447,6 +448,8 @@ func newcfg(firstp *obj.Prog) []*BasicBlock {
// Stop before an unreachable RET, to avoid creating
// unreachable control flow nodes.
if p.Link != nil && p.Link.As == obj.ARET && p.Link.Mode == 1 {
// TODO: remove after SSA is done. SSA does not
// generate any unreachable RET instructions.
break
}

@@ -1364,7 +1367,7 @@ func livenessepilogue(lv *Liveness) {
}
n = lv.vars[j]
if n.Class != PPARAM {
yyerrorl(int(p.Lineno), "internal error: %v %v recorded as live on entry", Curfn.Func.Nname, Nconv(n, obj.FmtLong))
yyerrorl(int(p.Lineno), "internal error: %v %v recorded as live on entry, p.Pc=%v", Curfn.Func.Nname, Nconv(n, obj.FmtLong), p.Pc)
}
}
}
@@ -1389,8 +1392,13 @@ func livenessepilogue(lv *Liveness) {
if msg != nil {
fmt_ = ""
fmt_ += fmt.Sprintf("%v: live at ", p.Line())
if p.As == obj.ACALL && p.To.Node != nil {
fmt_ += fmt.Sprintf("call to %s:", ((p.To.Node).(*Node)).Sym.Name)
if p.As == obj.ACALL && p.To.Sym != nil {
name := p.To.Sym.Name
i := strings.Index(name, ".")
if i >= 0 {
name = name[i+1:]
}
fmt_ += fmt.Sprintf("call to %s:", name)
} else if p.As == obj.ACALL {
fmt_ += "indirect call:"
} else {

0 comments on commit a6fb2ae

Please sign in to comment.
You can’t perform that action at this time.