compiler: use temporary variable for stack allocation
commit06e83d10e60a404f387e0f4df7c75953d53795d4
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Jan 2018 23:56:54 +0000 (9 23:56 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Jan 2018 23:56:54 +0000 (9 23:56 +0000)
tree2e759dfa0ae434d9a556946c8dabf9047e2fc444
parentc7fe5993647827df7289762018b0d4d56b9f6670
compiler: use temporary variable for stack allocation

    Currently, allocation expression that can be allocated on stack
    is implemented with __builtin_alloca, which turns into
    __morestack_allocate_stack_space, which may call C malloc. This
    may be slow. Also if this happens during certain runtime
    functions (e.g. write barrier), bad things might happen (when
    the escape analysis is enabled for the runtime). Make a temporary
    variable on stack for the allocation instead.

    Also remove the write barrier in the assignment in building heap
    expression when it is stack allocated.

    Reviewed-on: https://go-review.googlesource.com/86242

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