https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98737
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- That peephole handles only constants, i.e. _Bool h(void) { return __sync_fetch_and_add(&a, -32) == 32; } _Bool i(void) { return __sync_fetch_and_add(&a, 64) == -64; } Anyway, for #c0 the peephole2 would need to match because it is op_fetch rather than fetch_op the UNSPEC_XCHG followed by the operation again followed by comparison.