[libc-commits] [libc] [libc] Read known objects bytewise in the clang_vector string loads (PR #236612)
Mike Lothian via libc-commits
libc-commits at lists.llvm.org
Thu Oct 29 12:10:36 PDT 2026
FireBurn wrote:
Thanks, that works. I replaced the asm with a `__builtin_object_size` check that reads a known object bytewise. The asm was wrong on its own: it hides where the pointer came from, so the compiler can drop the stores into a local array, and strlen returned 0 for a stack array at -O3. The object size is resolved after inlining, so it also holds under thin LTO across files. I checked a two file case at -O0, -O3 and -O3 -flto=thin, and built the strlen, strcat, strncat, strstr and memchr unit tests with -O3 -march=native -flto=thin
https://github.com/llvm/llvm-project/pull/236612
More information about the libc-commits
mailing list