https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106939
--- Comment #4 from Arseny Vakhrushev <neoxic at icloud dot com> --- Thanks a lot, Andrew! Totally my bad. Well, comparison seems to work too: extern char _src[], _dst[], _end[]; // Defined by the linker int main(void) { char *src = &_src[0]; char *dst = &_dst[0]; char *end = &_end[0]; while (src < end) *dst++ = *src++; return 0; } Are the asm("" : "+r" (p)) statements strictly needed?