]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: rework marking of dead hidden closure functions
authorThan McIntosh <thanm@google.com>
Fri, 14 Apr 2023 18:07:37 +0000 (14:07 -0400)
committerThan McIntosh <thanm@google.com>
Fri, 5 May 2023 21:04:28 +0000 (21:04 +0000)
commitea69de9b921a1c1abbfe82012194c8e946e14cfd
tree7fc8c58691265203ad46968483295a17a6a9a699
parent10ad6c91de1e6de122edb7f5c3f6eae344ee861e
cmd/compile: rework marking of dead hidden closure functions

[This is a roll-forward of CL 484859, this time including a fix for
issue #59709. The call to do dead function marking was taking place in
the wrong spot, causing it to run more than once if generics were
instantiated.]

This patch generalizes the code in the inliner that marks unreferenced
hidden closure functions as dead. Rather than doing the marking on the
fly (previous approach), this new approach does a single pass at the
end of inlining, which catches more dead functions.

Change-Id: I0e079ad755c21295477201acbd7e1a732a98fffd
Reviewed-on: https://go-review.googlesource.com/c/go/+/492016
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/compile/internal/inline/inl.go
test/fixedbugs/issue59638.go [new file with mode: 0644]
test/fixedbugs/issue59709.dir/aconfig.go [new file with mode: 0644]
test/fixedbugs/issue59709.dir/bresource.go [new file with mode: 0644]
test/fixedbugs/issue59709.dir/cmem.go [new file with mode: 0644]
test/fixedbugs/issue59709.dir/dcache.go [new file with mode: 0644]
test/fixedbugs/issue59709.dir/main.go [new file with mode: 0644]
test/fixedbugs/issue59709.go [new file with mode: 0644]