]> git.ipfire.org Git - thirdparty/gcc.git/commit
compiler: statically allocate constant interface data
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Jun 2019 00:18:17 +0000 (00:18 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Jun 2019 00:18:17 +0000 (00:18 +0000)
commite47edcf78cf5a5e964e20c36d4097c72b77cde68
tree0bd3561a889220cfb173c2bdcb4e8cdbe9cf64fb
parent497eca91b241f46a1ec366772dd45ec714a790d8
compiler: statically allocate constant interface data

    When converting a constant to interface, such as interface{}(42)
    or interface{}("hello"), if the interface escapes, we currently
    generate a heap allocation to hold the constant value.

    This CL changes it to generate a static allocation instead, as
    the gc compiler does. This reduces allocations in such cases.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271945 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc