From: Russ Cox Date: Mon, 30 Nov 2020 19:16:39 +0000 (-0500) Subject: [dev.regabi] cmd/compile: clean up ONEW node X-Git-Tag: go1.17beta1~1539^2~414 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2bc814cd18b582030f25d22e0a3e80d4d30b19cf;p=gostls13.git [dev.regabi] cmd/compile: clean up ONEW node The list is no longer needed and can be deleted. Doing so reduces the inlining cost of any function containing an explicit call to new by 1 point, so this change is not toolstash -cmp safe. Change-Id: Id29e115d68e466a353708ab4b8c1021e9c85a628 Reviewed-on: https://go-review.googlesource.com/c/go/+/274132 Trust: Russ Cox Reviewed-by: Matthew Dempsky --- diff --git a/src/cmd/compile/internal/gc/typecheck.go b/src/cmd/compile/internal/gc/typecheck.go index f021ea48b1..874594d764 100644 --- a/src/cmd/compile/internal/gc/typecheck.go +++ b/src/cmd/compile/internal/gc/typecheck.go @@ -1315,11 +1315,6 @@ func typecheck1(n ir.Node, top int) (res ir.Node) { old := n n = ir.NodAt(n.Pos(), l.SubOp(), arg, nil) n = addinit(n, old.Init().Slice()) // typecheckargs can add to old.Init - if l.SubOp() == ir.ONEW { - // Bug-compatibility with earlier version. - // This extra node is unnecessary but raises the inlining cost by 1. - n.SetList(old.List()) - } case ir.OCOMPLEX, ir.OCOPY: typecheckargs(n)