]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: ignore non-code nodes when inlining
authorMark Pulford <mark@kyne.com.au>
Sun, 3 Sep 2017 13:53:38 +0000 (23:53 +1000)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 4 Sep 2017 00:07:33 +0000 (00:07 +0000)
Avoid counting nodes that don't generate code (eg, constants) against the
inlining budget.

Fixes #21749

Change-Id: I10fca073e64be7d304709ef33e125eb8c78d5e4d
Reviewed-on: https://go-review.googlesource.com/61250
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/compile/internal/gc/inl.go

index dfa13e3c3b3561619db5500bb5f304e7181e976d..f9f273f5a8f1951d29094410eaf49b08e70ceef1 100644 (file)
@@ -279,6 +279,10 @@ func (v *hairyVisitor) visit(n *Node) bool {
                ORETJMP:
                v.reason = "unhandled op " + n.Op.String()
                return true
+
+       case ODCLCONST, OEMPTY, OFALL, OLABEL:
+               // These nodes don't produce code; omit from inlining budget.
+               return false
        }
 
        v.budget--