This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/70140] Inefficient expansion of __builtin_mempcpy
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 14 Jul 2017 13:01:02 +0000
- Subject: [Bug middle-end/70140] Inefficient expansion of __builtin_mempcpy
- Auto-submitted: auto-generated
- References: <bug-70140-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70140
--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Wilco from comment #3)
> Yes. Ignoring GLIBC internals, mempcpy is used quite infrequently. As a
> result not many targets have added highly optimized implementations. The
> targets that do have the issue that mempcpy is typically not in the cache
> when called, while memcpy is more likely already cached.
>
FWIW, in x86-64 glibc, memcpy and mempcpy share the same function
body:
0000000000000010 <__mempcpy>:
10: 48 89 f8 mov %rdi,%rax
13: 48 01 d0 add %rdx,%rax
16: eb 1b jmp 33 <__memcpy+0x3>