compiler: move slice construction to callers of makeslice
authorIan Lance Taylor <ian@gcc.gnu.org>
Mon, 7 Jan 2019 21:44:06 +0000 (21:44 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 7 Jan 2019 21:44:06 +0000 (21:44 +0000)
commitfdcef314bcb0728d883cd87d6950d85217e82755
treef1a09ca36cb906a2fd919ddc7f148f232e58109b
parent575eb8f58b06657c9cadfe6f7ddfd9e530fe5dea
compiler: move slice construction to callers of makeslice

    This is the gccgo version of https://golang.org/cl/141822:

        Only return a pointer p to the new slices backing array from makeslice.
        Makeslice callers then construct sliceheader{p, len, cap} explictly
        instead of makeslice returning the slice.

    This change caused the GCC backend to break the runtime/pprof test by
    merging together the identical functions allocateReflectTransient and
    allocateTransient2M.  This caused the traceback to be other than
    expected.  Fix that by making the functions not identical.

    This is a step toward updating libgo to the Go1.12beta1 release.

    Reviewed-on: https://go-review.googlesource.com/c/155937

From-SVN: r267660
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/escape.cc
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h
gcc/go/gofrontend/runtime.def
gcc/go/gofrontend/wb.cc
libgo/go/runtime/pprof/mprof_test.go
libgo/go/runtime/slice.go