diff options
author | Cherry Zhang <cherryyz@google.com> | 2019-07-02 16:47:48 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-07-02 16:47:48 +0000 |
commit | e2790e1eab7bfaae5a733ed742a59a518253a645 (patch) | |
tree | b3c80682051e61f7267a88209da91bec78937dff /gcc/go/go-gcc.cc | |
parent | dab0477b0bbcc90418a7e1aec40b465de3ec842c (diff) | |
download | gcc-e2790e1eab7bfaae5a733ed742a59a518253a645.zip gcc-e2790e1eab7bfaae5a733ed742a59a518253a645.tar.gz gcc-e2790e1eab7bfaae5a733ed742a59a518253a645.tar.bz2 |
compiler: use builtin memset for non-pointer memclr
For zeroing a range of memory that doesn't contain pointer, we
can use builtin memset directly.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/184438
* go-gcc.cc (Gcc_backend::Gcc_backend): Define __builtin_memset.
From-SVN: r272944
Diffstat (limited to 'gcc/go/go-gcc.cc')
-rw-r--r-- | gcc/go/go-gcc.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc index 879149e..d9fc1a7 100644 --- a/gcc/go/go-gcc.cc +++ b/gcc/go/go-gcc.cc @@ -613,6 +613,15 @@ Gcc_backend::Gcc_backend() NULL_TREE), false, false); + // We use __builtin_memset for zeroing data. + this->define_builtin(BUILT_IN_MEMSET, "__builtin_memset", "memset", + build_function_type_list(void_type_node, + ptr_type_node, + integer_type_node, + size_type_node, + NULL_TREE), + false, false); + // Used by runtime/internal/sys and math/bits. this->define_builtin(BUILT_IN_CTZ, "__builtin_ctz", "ctz", build_function_type_list(integer_type_node, |