https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107676
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2022-11-14 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Maybe this is better: For loops that are emitted by __atomic_compare_and_exchange (and other __atomic* builtins which emit a compare and exechange loop, e.g. ....), emit an atomic load before the loop and if the value was not the expected value, emit a pause instruction. This might reduce execussive cache bouncing of the memory. Note replace .... with other builtin which also emits a compare and exchange loop.