diff options
author | ienkovich <ienkovich@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-29 12:52:42 +0000 |
---|---|---|
committer | ienkovich <ienkovich@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-29 12:52:42 +0000 |
commit | ec55997c7e14b10107deb341e84b56409cea8358 (patch) | |
tree | 15fb381620421c16562fcbe81b00c4e41e55af5c /libmpx | |
parent | a4a2d1bae2c88f73c0c6b4eab5739a1e93150b24 (diff) | |
download | gcc-ec55997c7e14b10107deb341e84b56409cea8358.tar.gz |
libmpx/
2015-12-29 Tsvetkova Alexandra <aleksandra.tsvetkova@intel.com>
* libmpxwrap/mpx_wrappers.c (__mpx_wrapper_memmove): Special
handling of one pointer copy.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231991 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libmpx')
-rw-r--r-- | libmpx/ChangeLog | 5 | ||||
-rw-r--r-- | libmpx/mpxwrap/mpx_wrappers.c | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/libmpx/ChangeLog b/libmpx/ChangeLog index 93924a8e6dd..d5308077849 100644 --- a/libmpx/ChangeLog +++ b/libmpx/ChangeLog @@ -1,3 +1,8 @@ +2015-12-29 Tsvetkova Alexandra <aleksandra.tsvetkova@intel.com> + + * libmpxwrap/mpx_wrappers.c (__mpx_wrapper_memmove): Special + handling of one pointer copy. + 2015-12-11 Tsvetkova Alexandra <aleksandra.tsvetkova@intel.com> * mpxrt/Makefile.am (libmpx_la_LDFLAGS): Add -version-info diff --git a/libmpx/mpxwrap/mpx_wrappers.c b/libmpx/mpxwrap/mpx_wrappers.c index ffa7e7ee5ff..4df4e9e76e8 100644 --- a/libmpx/mpxwrap/mpx_wrappers.c +++ b/libmpx/mpxwrap/mpx_wrappers.c @@ -483,7 +483,18 @@ __mpx_wrapper_memmove (void *dst, const void *src, size_t n) __bnd_chk_ptr_bounds (dst, n); __bnd_chk_ptr_bounds (src, n); + /* When we copy exactly one pointer it is faster to + just use bndldx + bndstx. */ + if (n == sizeof (void *)) + { + const void **s = (const void**)src; + void **d = (void**)dst; + *d = *s; + return dst; + } + memmove (dst, src, n); + /* Not necessary to copy bounds if size is less then size of pointer or SRC==DST. */ if ((n >= sizeof (void *)) && (src != dst)) |