https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104800

--- Comment #25 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to uecker from comment #24)
> For C++ a builtin was added that acts as a barrier for std::observable. This
> could potentially be emitted by the C frontend after each volatile access. 

That would work, on the GIMPLE side at least.

> https://gcc.gnu.org/cgit/gcc/commit/
> ?id=9056b5faa87df59fb8eb2f92096a8e6e7d246757
> 
> I do not understand the test case though, as the addition is not volatile,
> so it may have stronger semantics than what is needed here. 

It depends on what is considered "observable", here the global variable
write is supposedly so.

> (IIRC, in C the function without return would also not have UB as long as
> the return value is not used.).

Reply via email to