]> git.ipfire.org Git - thirdparty/gcc.git/commit
compiler: avoid copy for string([]byte) conversion used in string concatenation
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Jun 2019 23:55:50 +0000 (23:55 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Jun 2019 23:55:50 +0000 (23:55 +0000)
commitcb9d693f3e01c54dfa75e08be6df36f57bcb3adb
tree251712aed0fe7f6df1a7e269149d6854d66555cc
parentb93041f0d3c9a2fc64f0f5fb538e78d5e2001d32
compiler: avoid copy for string([]byte) conversion used in string concatenation

    If a string([]byte) conversion is used immediately in a string
    concatenation, we don't need to copy the backing store of the
    byte slice, as the runtime function doesn't hold any reference
    to it.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/182437

* go.dg/concatstring.go: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272460 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc
gcc/testsuite/ChangeLog
gcc/testsuite/go.dg/concatstring.go [new file with mode: 0644]