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

2024-07-06 Thread securesneakers at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115802 --- Comment #9 from Ivan Bodrov --- Created attachment 58598 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58598&action=edit Minimal program to reproduce the issue (no condvar) To further simplify the original code, the condition variabl

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

2024-07-06 Thread securesneakers at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115802 --- Comment #8 from Ivan Bodrov --- 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

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

2024-07-06 Thread securesneakers at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115802 --- Comment #6 from Ivan Bodrov --- Created attachment 58597 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58597&action=edit Smaller, but non runnable example. Full demo code for the above (can't be run, only shows code generation). Can

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

2024-07-06 Thread securesneakers at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115802 --- Comment #5 from Ivan Bodrov --- Without the mutex threads would race for the first access to non-atomic variable. Seq-Cst ordering is only used to simplify the example, it can be relaxed to acquire/release/relaxed for different operations.

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

2024-07-05 Thread securesneakers at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115802 --- Comment #3 from Ivan Bodrov --- Yes, but "wait" operation is not supposed to touch anything. The example shows typical usage of condition variable, except "real" code usually accesses data through some pointer, not as a static variable. Or

[Bug rtl-optimization/115802] New: Non-atomic load of static variable moved out of loop despite atomic fences

2024-07-05 Thread securesneakers at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115802 Bug ID: 115802 Summary: Non-atomic load of static variable moved out of loop despite atomic fences Product: gcc Version: 14.1.1 Status: UNCONFIRMED Severity: n

[Bug target/110184] [x86] Missed optimisation: atomic operations should use PF, ZF and SF

2023-11-19 Thread securesneakers at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110184 --- Comment #3 from Ivan Bodrov --- Created attachment 56646 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56646&action=edit Fails to apply optimization for __atomic_fetch_and ZF-flag with separate literals

[Bug target/110184] [x86] Missed optimisation: atomic operations should use PF, ZF and SF

2023-11-19 Thread securesneakers at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110184 Ivan Bodrov changed: What|Removed |Added CC||securesneakers at gmail dot com --- Comme