[llvm-bugs] [Bug 46734] New: Failure to optimize __builtin___memcpy_chk optimally
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Jul 15 08:52:28 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=46734
Bug ID: 46734
Summary: Failure to optimize __builtin___memcpy_chk optimally
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: X86
Assignee: unassignedbugs at nondot.org
Reporter: gabravier at gmail.com
CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
llvm-dev at redking.me.uk, spatel+llvm at rotateright.com
void *f(void *d, const void *s, size_t l)
{
return __builtin___memcpy_chk(d, s, l, __builtin_object_size(d, 0));
}
With -O3, GCC outputs this :
f(void*, void const*, unsigned long):
jmp memcpy
LLVM outputs this :
f(void*, void const*, unsigned long):
push rbx
mov rbx, rdi
call memcpy
mov rax, rbx
pop rbx
ret
The same bad code generation can be seen with the same code, but using
`__builtin___memmove_chk` instead of `__builtin___memcpy_chk`.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200715/93264c00/attachment.html>
More information about the llvm-bugs
mailing list