i386: Fix infinite loop under -mrelax-cmpxchg-loop [PR 103069]
authorHongyu Wang <hongyu.wang@intel.com>
Wed, 13 Apr 2022 06:51:36 +0000 (14:51 +0800)
committerHongyu Wang <hongyu.wang@intel.com>
Wed, 13 Apr 2022 08:17:27 +0000 (16:17 +0800)
commit522f25e90c781d284f8347a04940db8b41c42fd5
tree3ae7f61f4cb464e533e678d0a3a0f68517d1681c
parent41f8f8b8a4ffcf28961cdc077fd7f0770f4bb7cc
i386: Fix infinite loop under -mrelax-cmpxchg-loop [PR 103069]

For -mrelax-cmpxchg-loop which relaxes atomic_fetch_<logic> loops,
there is a missing set to %eax when compare fails, which would result
in infinite loop in some benchmark. Add set to %eax to avoid it.

gcc/ChangeLog:

PR target/103069
* config/i386/i386-expand.cc (ix86_expand_cmpxchg_loop):
  Add missing set to target_val at pause label.
gcc/config/i386/i386-expand.cc