https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102566
--- Comment #34 from H.J. Lu <hjl.tools at gmail dot com> --- Created attachment 53813 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53813&action=edit A patch to handle if (_5 < 0) A patch to extend optimization for _1 = __atomic_fetch_or_4 (ptr_6, 0x80000000, _3); _5 = (signed int) _1; _4 = _5 >= 0; to _1 = __atomic_fetch_or_4 (ptr_6, 0x80000000, _3); _5 = (signed int) _1; if (_5 >= 0)