Re: [PATCH] i386: Fix wrong codegen for -mrelax-cmpxchg-loop

2021-11-18 Thread Uros Bizjak via Gcc-patches
On Thu, Nov 18, 2021 at 8:37 AM Hongyu Wang wrote: > > Hi Uros, > > For -mrelax-cmpxchg-loop introduced by PR 103069/r12-5265, it would > produce infinite loop. The correct code should be > > .L84: > movl(%rdi), %ecx > movl%eax, %edx > orl %esi, %edx > c

[PATCH] i386: Fix wrong codegen for -mrelax-cmpxchg-loop

2021-11-17 Thread Hongyu Wang via Gcc-patches
Hi Uros, For -mrelax-cmpxchg-loop introduced by PR 103069/r12-5265, it would produce infinite loop. The correct code should be .L84: movl(%rdi), %ecx movl%eax, %edx orl %esi, %edx cmpl%eax, %ecx jne .L82 lock cmpxchgl %edx, (%r