https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66865
--- Comment #13 from Uroš Bizjak <ubizjak at gmail dot com> --- (In reply to kugan from comment #12) > Thanks. I can now reproduce it. However, If I just use the changes to > gcc/postreload.c (changes for bug 66838), I can get the trunk to work. I can confrim this with [trunk revision 225805], please see insn @9c, it reloads %rsi. 0000000000000010 <RtlConvertSidToUnicodeString>: 10: 55 push %rbp 11: 57 push %rdi 12: 31 c0 xor %eax,%eax 14: 56 push %rsi 15: 53 push %rbx 16: 48 89 d3 mov %rdx,%rbx 19: 48 8d 35 00 00 00 00 lea 0(%rip),%rsi # 20 <RtlConvertSidToUnicodeString+0x10> 1c: R_X86_64_PC32 .rodata+0xfffffffffffffffc 20: 48 81 ec 08 02 00 00 sub $0x208,%rsp 27: 0f 29 b4 24 60 01 00 movaps %xmm6,0x160(%rsp) 2e: 00 2f: 48 89 e7 mov %rsp,%rdi 32: 48 89 e5 mov %rsp,%rbp 35: 0f 29 bc 24 70 01 00 movaps %xmm7,0x170(%rsp) 3c: 00 3d: 44 0f 29 84 24 80 01 movaps %xmm8,0x180(%rsp) 44: 00 00 46: 44 0f 29 8c 24 90 01 movaps %xmm9,0x190(%rsp) 4d: 00 00 4f: 44 0f 29 94 24 a0 01 movaps %xmm10,0x1a0(%rsp) 56: 00 00 58: 44 0f 29 9c 24 b0 01 movaps %xmm11,0x1b0(%rsp) 5f: 00 00 61: 44 0f 29 a4 24 c0 01 movaps %xmm12,0x1c0(%rsp) 68: 00 00 6a: 44 0f 29 ac 24 d0 01 movaps %xmm13,0x1d0(%rsp) 71: 00 00 73: 44 0f 29 b4 24 e0 01 movaps %xmm14,0x1e0(%rsp) 7a: 00 00 7c: 44 0f 29 bc 24 f0 01 movaps %xmm15,0x1f0(%rsp) 83: 00 00 85: 0f b6 12 movzbl (%rdx),%edx 88: e8 00 00 00 00 callq 8d <RtlConvertSidToUnicodeString+0x7d> 89: R_X86_64_PLT32 sprintfW+0xfffffffffffffffc 8d: 0f b6 53 03 movzbl 0x3(%rbx),%edx 91: 0f b6 4b 04 movzbl 0x4(%rbx),%ecx 95: 48 98 cltq 97: 48 8d 7c 45 00 lea 0x0(%rbp,%rax,2),%rdi 9c: 48 8d 35 00 00 00 00 lea 0(%rip),%rsi # a3 <RtlConvertSidToUnicodeString+0x93> 9f: R_X86_64_PC32 .rodata+0xfffffffffffffffc a3: 31 c0 xor %eax,%eax a5: c1 e2 08 shl $0x8,%edx a8: 09 ca or %ecx,%edx aa: 0f b6 4b 05 movzbl 0x5(%rbx),%ecx ae: c1 e2 10 shl $0x10,%edx b1: c1 e1 08 shl $0x8,%ecx b4: 0f b7 c9 movzwl %cx,%ecx b7: 09 ca or %ecx,%edx b9: e8 00 00 00 00 callq be <RtlConvertSidToUnicodeString+0xae> ba: R_X86_64_PLT32 sprintfW+0xfffffffffffffffc be: 0f 28 b4 24 60 01 00 movaps 0x160(%rsp),%xmm6 c5: 00 c6: 0f 28 bc 24 70 01 00 movaps 0x170(%rsp),%xmm7 cd: 00 ce: 44 0f 28 84 24 80 01 movaps 0x180(%rsp),%xmm8 d5: 00 00 d7: 44 0f 28 8c 24 90 01 movaps 0x190(%rsp),%xmm9 de: 00 00 e0: 44 0f 28 94 24 a0 01 movaps 0x1a0(%rsp),%xmm10 e7: 00 00 e9: 44 0f 28 9c 24 b0 01 movaps 0x1b0(%rsp),%xmm11 f0: 00 00 f2: 44 0f 28 a4 24 c0 01 movaps 0x1c0(%rsp),%xmm12 f9: 00 00 fb: 44 0f 28 ac 24 d0 01 movaps 0x1d0(%rsp),%xmm13 102: 00 00 104: 44 0f 28 b4 24 e0 01 movaps 0x1e0(%rsp),%xmm14 10b: 00 00 10d: 44 0f 28 bc 24 f0 01 movaps 0x1f0(%rsp),%xmm15 114: 00 00 116: 48 81 c4 08 02 00 00 add $0x208,%rsp 11d: 5b pop %rbx 11e: 5e pop %rsi 11f: 5f pop %rdi 120: 5d pop %rbp 121: c3 retq