https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120001
--- Comment #2 from Vincenzo Romano <vincenzo.romano at gmail dot com> --- If I put __sync_fetch_and_or instead of __sync_or_and_fetch I objously get the expected behavior as fas as the endless loop is concerned.