[Bug middle-end/114923] gcc ignores escaping pointer and applies invalid optimization

2024-05-02 Thread nfxjfg at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114923 --- Comment #9 from nfxjfg at googlemail dot com --- Oh, I completely missed that your statement was restricted to "in HW". Normally there are mechanisms in place that make all CPU-level memory accesses to registers strictly ordered. (In our

[Bug middle-end/114923] gcc ignores escaping pointer and applies invalid optimization

2024-05-02 Thread nfxjfg at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114923 --- Comment #7 from nfxjfg at googlemail dot com --- > Note also the order of the writes to reg1 and reg2 might happen in a > different order in HW so you need to have a full (HW) write barrier between > them to make sure the write is done in

[Bug c/114923] gcc ignores escaping pointer and applies invalid optimization

2024-05-02 Thread nfxjfg at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114923 --- Comment #3 from nfxjfg at googlemail dot com --- I'm expecting gcc to realize that the pointer escaped into the unknown, and that it can't assume that the memory won't change. This is just causality, not any vague made up viralyness.

[Bug c/114923] gcc ignores escaping pointer and applies invalid optimization

2024-05-02 Thread nfxjfg at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114923 --- Comment #1 from nfxjfg at googlemail dot com --- To make this explicitly clear: I expect that gcc reads back the buf value from memory and returns that.

[Bug c/114923] New: gcc ignores escaping pointer and applies invalid optimization

2024-05-02 Thread nfxjfg at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114923 Bug ID: 114923 Summary: gcc ignores escaping pointer and applies invalid optimization Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal