]> git.ipfire.org Git - thirdparty/gcc.git/commit
compiler: in composite literals use temps only for interfaces
authorIan Lance Taylor <iant@golang.org>
Mon, 28 Jun 2021 23:47:55 +0000 (16:47 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 29 Jun 2021 18:01:19 +0000 (11:01 -0700)
commit8a8a7d332d5d01db5aea7336a36d9fd71a679fb1
treecb442340b2a2dc94907f1f3499ccb6eed343d4f3
parentc60d9160b4d966dbea5b1bbea4f817c64d0bee2d
compiler: in composite literals use temps only for interfaces

For a composite literal we only need to introduce a temporary variable
if we may be converting to an interface type, so only do it then.
This saves over 80% of compilation time when using gccgo to compile
cmd/internal/obj/x86, as the GCC middle-end spends a lot of time
pointlessly computing interactions between temporary variables.

For PR debug/101064
For golang/go#46600

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/331513
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc