http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55966
--- Comment #4 from Uros Bizjak <ubizjak at gmail dot com> 2013-01-14 21:22:35 UTC --- The problem is, that in failed case maybe_emit_op() gets target register to return the result to, so with after=false, it expands via optab->mem_fetch_before. Unfortunately, atomic_fetch_<logic> or atomic_<logic>_fetch do not exist for x86 target, so generic expander falls back to exchange loop.