https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106078
--- Comment #5 from hubicka at kam dot mff.cuni.cz --- > > For this one it's PRE hoisting *b across the endless loop (PRE handles > > calls as possibly not returning but not loops as possibly not > > terminating...) > > So it's a different bug. > > Btw, C++ requiring forward progress makes the testcase undefined. In my understanding access to volatile variable is a forward progres: In a valid C++ program, every thread eventually does one of the following: -terminate -makes a call to an I/O library function -performs an access through a volatile glvalue -performs an atomic operation or a synchronization operation I think one can also replace volatile access by atomics: we only need to know the side effects of that operation. Honza