[Bug tree-optimization/104665] Failure to recognize memcpy
monad at posteo dot net
gcc-bugzilla@gcc.gnu.org
Wed Feb 23 16:55:08 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104665
--- Comment #2 from monad at posteo dot net ---
The full code including headers is:
#include <cstddef>
#include <cstdint>
#include <cstring>
void serialize_le(std::byte* __restrict dst, const std::uint32_t* __restrict
src)
{
for (int i = 0; i < 32; ++i, ++src)
{
*dst++ = static_cast<std::byte>((*src >> 24) & 0xff);
*dst++ = static_cast<std::byte>((*src >> 16) & 0xff);
*dst++ = static_cast<std::byte>((*src >> 8) & 0xff);
*dst++ = static_cast<std::byte>((*src >> 0) & 0xff);
}
}
More information about the Gcc-bugs
mailing list