https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99828

--- Comment #14 from Jiri Slaby <jirislaby at gmail dot com> ---
(In reply to Richard Biener from comment #13)
> The testcase still does not work on master or with 12.2, thus reconfirmed.

Hmm:

(In reply to Martin Liška from comment #0)
> Noticed by Andi Kleen in kernel, reduced to:
> 
> $ cat 1.i
> __attribute__((__always_inline__)) void *memcpy();
> void *foo = memcpy;

Provided I cannot reproduce on the current kernel, where exactly does this come
from?

I see:

arch/x86/include/asm/string_64.h:
#define __HAVE_ARCH_MEMCPY 1
extern void *memcpy(void *to, const void *from, size_t len);
extern void *__memcpy(void *to, const void *from, size_t len);

===

For KASAN also:
#if defined(CONFIG_KASAN) && !defined(__SANITIZE_ADDRESS__)

#undef memcpy
#define memcpy(dst, src, len) __memcpy(dst, src, len)

===

arch/x86/lib/memcpy_64.S:
SYM_FUNC_START(__memcpy)
...
SYM_FUNC_END(__memcpy)
...
SYM_FUNC_ALIAS_WEAK(memcpy, __memcpy)

===

$ nm ../lto/vmlinux|grep -wE '__memcpy|memcpy'
ffffffff81dcf0b0 T __memcpy
ffffffff81dcf0b0 W memcpy

===

arch/x86/lib/memcpy_32.c:
__used __visible void *memcpy(void *to, const void *from, size_t n)
{
        return __memcpy(to, from, n);
}

Reply via email to