https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115726
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- It seems to work on x86_64 for __attribute__((noinline, noclone)) char xload8_r30 (const __seg_gs char *pc) { register char c __asm ("rax"); c = *pc; __asm (";;" : "+r" (c)); return c; } resulting in the expected (note rax is also the return register, it also works with rdx with a correct move to rax appearing before the return). xload8_r30: .LFB0: .cfi_startproc movb %gs:(%rdi), %al #APP # 6 "t.c" 1 ;; # 0 "" 2 #NO_APP ret