]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: fix transitive inlining of generic functions
authorMatthew Dempsky <mdempsky@google.com>
Mon, 17 Oct 2022 23:57:07 +0000 (16:57 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 8 Nov 2022 21:26:09 +0000 (21:26 +0000)
commit9944ba757b0f8005cfb7715d41592c7e13c0a2b8
tree42e0158764779d2e9a521beb4161e9ce84264944
parenta7538d78214920b798a1914a2a789ae833d6f1e1
cmd/compile: fix transitive inlining of generic functions

If an imported, non-generic function F transitively calls a generic
function G[T], we may need to call CanInline on G[T].

While here, we can also take advantage of the fact that we know G[T]
was already seen and compiled in an imported package, so we don't need
to call InlineCalls or add it to typecheck.Target.Decls. This saves us
from wasting compile time re-creating DUPOK symbols that we know
already exist in the imported package's link objects.

Fixes #56280.

Change-Id: I3336786bee01616ee9f2b18908738e4ca41c8102
Reviewed-on: https://go-review.googlesource.com/c/go/+/443535
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/inline/inl.go
src/cmd/compile/internal/noder/reader.go
src/cmd/compile/internal/noder/unified.go
test/fixedbugs/issue56280.dir/a.go [new file with mode: 0644]
test/fixedbugs/issue56280.dir/main.go [new file with mode: 0644]
test/fixedbugs/issue56280.go [new file with mode: 0644]
test/run.go