[Bug middle-end/115802] Non-atomic load of static variable moved out of loop despite atomic fences

securesneakers at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat Jul 6 14:21:03 GMT 2024


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

--- Comment #8 from Ivan Bodrov <securesneakers at gmail dot com> ---
The 2nd example is only intended to show changes in code generation after the
fence is moved to the function that is visible, but is not inlined, which is
the cause of this  issue. The code is not supposed to be correct.

This is why the original example has a complete mutex + condvar.


More information about the Gcc-bugs mailing list