This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Go patch committed: Use temporary variable for stack allocation


This patch to the Go frontend by Cherry Zhang uses a temporary
variable for stack allocation when possible.  Currently, an allocation
expression that can be allocated on stack is implemented with
__builtin_alloca, which turns into __morestack_allocate_stack_space,
which may call the C malloc function.  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.  Bootstrapped on
x86_64-pc-linux-gnu.   Committed to mainline.

Ian

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]