[Bug tree-optimization/116570] Write without read optimization is not applied to custom malloc/free even when marked as such

2024-09-02 Thread uis9936 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116570 --- Comment #6 from uis --- I looked into tree-ssa-dse.cc. Does it only work with builtins? I testes with mismatched free(malloc_test and regular free), store was removed.

[Bug tree-optimization/116570] Write without read optimization is not applied to custom malloc/free even when marked as such

2024-09-02 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116570 --- Comment #5 from Xi Ruoyao --- (In reply to uis from comment #4) > I tried even adding restrict keyword and leaf attribute. Why would they make any difference? If do_something_with is a macro the leaf attribute won't invalidate my example.

[Bug tree-optimization/116570] Write without read optimization is not applied to custom malloc/free even when marked as such

2024-09-02 Thread uis9936 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116570 --- Comment #4 from uis --- I tried even adding restrict keyword and leaf attribute.

[Bug tree-optimization/116570] Write without read optimization is not applied to custom malloc/free even when marked as such

2024-09-02 Thread uis9936 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116570 --- Comment #3 from uis --- And there is no way to tell compiler that store is dead without at least disabling writes to globals?

[Bug tree-optimization/116570] Write without read optimization is not applied to custom malloc/free even when marked as such

2024-09-02 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116570 Xi Ruoyao changed: What|Removed |Added CC||xry111 at gcc dot gnu.org Statu

[Bug tree-optimization/116570] Write without read optimization is not applied to custom malloc/free even when marked as such

2024-09-02 Thread uis9936 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116570 --- Comment #1 from uis --- Maybe I need some attribute to mark returned pointer as not potentially being memory-mapped file?