https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111657
--- Comment #10 from Uroš Bizjak <ubizjak at gmail dot com> --- Created attachment 61152 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61152&action=edit Patch that allows rep_prefix_{1,4,8}_byte algorithms from non-default address space Attached patch allows rep_prefix_{1,4,8}_byte memory copy algorithms from non-default address space. MOVS instruction allows segment override of their source operand, e.g.: rep movsq %gs:(%rsi),%es:(%rdi) where %rsi is an address of source location (with %gs override) and %rdi is an address of destination location. The testcase from Comment#0 now compiles to (-O2 -mno-sse): bar: movl $m, %esi movl $30, %ecx rep movsq %gs:(%rsi), (%rdi) ret