[Bug target/103069] cmpxchg isn't optimized

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Apr 13 08:18:00 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069

--- Comment #21 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Hongyu Wang <hongyuw@gcc.gnu.org>:

https://gcc.gnu.org/g:522f25e90c781d284f8347a04940db8b41c42fd5

commit r12-8136-g522f25e90c781d284f8347a04940db8b41c42fd5
Author: Hongyu Wang <hongyu.wang@intel.com>
Date:   Wed Apr 13 14:51:36 2022 +0800

    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.


More information about the Gcc-bugs mailing list