Commit 0ad9c8c7 authored by Keith Randall's avatar Keith Randall

[dev.ssa] cmd/compile/internal/gc: Small fixes

Allow labels to be unreachable via fallthrough from above.
Implement OCONVNOP.

Change-Id: I6869993cad8a27ad134dd637de89a40117daf47b
Reviewed-on: https://go-review.googlesource.com/11001Reviewed-by: default avatarDaniel Morsing <daniel.morsing@gmail.com>
parent d5ad9ced
......@@ -217,8 +217,9 @@ func (s *state) stmt(n *Node) {
s.labels[n.Left.Sym.Name] = t
}
// go to that label (we pretend "label:" is preceded by "goto label")
b := s.endBlock()
addEdge(b, t)
if b := s.endBlock(); b != nil {
addEdge(b, t)
}
if n.Op == OLABEL {
// next we work on the label's target block
......@@ -358,6 +359,9 @@ func (s *state) expr(n *Node) *ssa.Value {
log.Fatalf("unhandled OLITERAL %v", n.Val().Ctype())
return nil
}
case OCONVNOP:
x := s.expr(n.Left)
return s.newValue1(ssa.OpConvNop, n.Type, nil, x)
// binary ops
case OLT:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment