[libc-commits] [PATCH] D115542: [libc] fix memcpy builtin looping
Guillaume Chatelet via Phabricator via libc-commits
libc-commits at lists.llvm.org
Sun Dec 12 02:31:33 PST 2021
gchatelet accepted this revision.
gchatelet added inline comments.
Comment at: libc/src/string/memory_utils/elements.h:515
- __builtin_memcpy(dst, src, SIZE);
> This should be sufficient to fix the problem.
Yes but I think that the functions embedding `inline_memcpy` via [[ https://github.com/llvm/llvm-project/blob/main/libc/src/string/memory_utils/memcpy_implementations.h | memcpy_implementations.h ]] should still be marked `-fno-builtin-memcpy` overwise clang might still detect the copy for loop as `memcpy` and call it instead of embedding it.
To be safe we should have all string functions marked with `-fno-builtin`. This would prevent the recursive call for all of `memmove`, `memcmp`, `memset`, etc.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the libc-commits