Extended Description
typedef SIZE_TYPE size_t;
void idiom_memcpy_aliasing(unsigned char * dst, size_t d_len, unsigned char *src)
{
// no restrict, possible aliasing
unsigned char *d_end = dst + d_len;
// icc seems to produce memcpy when alias checks are OK and d_len j < 96, jumps to trivial copy loop otherwise.
while (dst < d_end)
*dst++ = *src++;
}
ICC -O2+ is able to do this kind of transformation.
https://godbolt.org/z/eK1P4YjMf