[Bug middle-end/106078] Invalid loop invariant motion with non-call-exceptions

Jan Hubicka hubicka@kam.mff.cuni.cz
Sat Jun 25 13:33:54 GMT 2022


> > 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


More information about the Gcc-bugs mailing list