aboutsummaryrefslogtreecommitdiff
path: root/libmpx/mpxwrap
diff options
context:
space:
mode:
authorTsvetkova Alexandra <aleksandra.tsvetkova@intel.com>2015-12-29 12:52:42 +0000
committerIlya Enkovich <ienkovich@gcc.gnu.org>2015-12-29 12:52:42 +0000
commit0bf0df50e5a18e7b707ba0091cb86e1bd388d4b3 (patch)
tree15fb381620421c16562fcbe81b00c4e41e55af5c /libmpx/mpxwrap
parent8c20a15574b1a551bc6b51b35129b56f69110ef9 (diff)
downloadgcc-0bf0df50e5a18e7b707ba0091cb86e1bd388d4b3.zip
gcc-0bf0df50e5a18e7b707ba0091cb86e1bd388d4b3.tar.gz
gcc-0bf0df50e5a18e7b707ba0091cb86e1bd388d4b3.tar.bz2
mpx_wrappers.c (__mpx_wrapper_memmove): Special handling of one pointer copy.
libmpx/ 2015-12-29 Tsvetkova Alexandra <aleksandra.tsvetkova@intel.com> * libmpxwrap/mpx_wrappers.c (__mpx_wrapper_memmove): Special handling of one pointer copy. From-SVN: r231991
Diffstat (limited to 'libmpx/mpxwrap')
-rw-r--r--libmpx/mpxwrap/mpx_wrappers.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libmpx/mpxwrap/mpx_wrappers.c b/libmpx/mpxwrap/mpx_wrappers.c
index ffa7e7e..4df4e9e 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))