aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/go-gcc.cc
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2019-05-08 17:40:45 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-05-08 17:40:45 +0000
commitfbe4e644c0c8f1303ec91a25b8da6e626976500c (patch)
tree87a1cfc98677c590f437af9209a3c78b34b5e9ef /gcc/go/go-gcc.cc
parent5345ac5a110a5fcafaa9bdf3116b8252de2d96c6 (diff)
downloadgcc-fbe4e644c0c8f1303ec91a25b8da6e626976500c.zip
gcc-fbe4e644c0c8f1303ec91a25b8da6e626976500c.tar.gz
gcc-fbe4e644c0c8f1303ec91a25b8da6e626976500c.tar.bz2
runtime: use builtin memmove directly
We can use the intrinsic memmove directly, without going through C. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/170004 * go-gcc.cc (Gcc_backend::Gcc_backend): Define memmove builtin. From-SVN: r271016
Diffstat (limited to 'gcc/go/go-gcc.cc')
-rw-r--r--gcc/go/go-gcc.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc
index 1a52d9b..e0e4333 100644
--- a/gcc/go/go-gcc.cc
+++ b/gcc/go/go-gcc.cc
@@ -604,6 +604,15 @@ Gcc_backend::Gcc_backend()
NULL_TREE),
false, false);
+ // We use __builtin_memmove for copying data.
+ this->define_builtin(BUILT_IN_MEMMOVE, "__builtin_memmove", "memmove",
+ build_function_type_list(void_type_node,
+ ptr_type_node,
+ const_ptr_type_node,
+ size_type_node,
+ NULL_TREE),
+ false, false);
+
// Used by runtime/internal/sys.
this->define_builtin(BUILT_IN_CTZ, "__builtin_ctz", "ctz",
build_function_type_list(integer_type_node,