https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68908
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amacleod at redhat dot com --- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Inviting Richard and Andrew to comment. I'm afraid that the pattern-matching approach would be quite fragile, but as Jakub pointed out elsewhere, it'd have the advantage that even user written code with manual atomic_load and compare_and_swap could be optimized into the fetch_and_* patterns.