https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109930
Wilco <wilco at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wilco at gcc dot gnu.org --- Comment #4 from Wilco <wilco at gcc dot gnu.org> --- (In reply to Simon Richter from comment #3) > I was looking at ARMv7 initially. > > If I understood the implementation correctly, this can be a generic > optimization. This optimization is only valid for release or relaxed semantics, otherwise you remove the acquire semantics of the exchange (without proof this is 100% safe, this will likely allow an illegal reordering). Btw if you know the old state then there is presumably no concurrent access here and so you don't need atomic, let alone sequential consistency.