]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: mark instantiated generic functions as DUPOK
authorMatthew Dempsky <mdempsky@google.com>
Tue, 8 Mar 2022 22:59:32 +0000 (14:59 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 9 Mar 2022 16:08:24 +0000 (16:08 +0000)
commit7160e3252991d9462ee3a155b5504c564a6cffe5
tree9ede4114102c4b9b9ecb8cde4416db313ed7eb96
parentc6d9b38dd82fea8775f1dff9a4a70a017463035d
cmd/compile: mark instantiated generic functions as DUPOK

Unified IR wasn't marking instantiated generic functions as DUPOK,
even though they can appear in multiple compilation units, which
evidently interfered with cmd/link's dead code elimination logic.

Manually confirmed to fix the issue, but non-trivial to test within
$GOROOT/test currently, because it's only reproducible when
cmd/compile is invoked with -p. @rsc is currently investigating
updating test/run.go appropriately, after which I'll revisit writing a
test case.

Fixes #51519.

Change-Id: I74a79ed0ca15b25b826e419714af5ceb6e567012
Reviewed-on: https://go-review.googlesource.com/c/go/+/390956
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/compile/internal/noder/reader.go