[Bug middle-end/67809] Empty pointer-chasing loops aren't optimized out

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67809 Andrew Pinski changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug middle-end/67809] Empty pointer-chasing loops aren't optimized out

2021-06-12 Thread gareth--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67809 Gareth Lloyd changed: What|Removed |Added CC||gar...@ignition-web.co.uk --- Comment #11

[Bug middle-end/67809] Empty pointer-chasing loops aren't optimized out

2019-04-15 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67809 --- Comment #10 from Marc Glisse --- "Forward progress [intro.progress] The implementation may assume that any thread will eventually do one of the following: (1.1) — terminate, (1.2) — make a call to a library I/O function, (1.3) — perform an ac

[Bug middle-end/67809] Empty pointer-chasing loops aren't optimized out

2019-04-15 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67809 --- Comment #9 from Richard Biener --- clang doesn't optimize the corresponding C testcase struct Foo { struct Foo *next; }; void release(struct Foo *next) { struct Foo *tmp = 0; for (struct Foo *it = next; it; it = tmp) {

[Bug middle-end/67809] Empty pointer-chasing loops aren't optimized out

2019-04-15 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67809 --- Comment #8 from Richard Biener --- So it's legal to remove the classical "halt CPU" while (1);? Interesting... Does this apply to C++ only? I presume for libstdc++ we could add a #pragma GCC loop finite which tells GCC it can assume the

[Bug middle-end/67809] Empty pointer-chasing loops aren't optimized out

2019-04-15 Thread gar...@ignition-web.co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67809 --- Comment #7 from Gareth Lloyd --- To give extra context, this optimization is desirable when using pmr::monotonic_buffer_resource. After de-virtualization and inlining it is likely for node based containers with trivially destructible internal

[Bug middle-end/67809] Empty pointer-chasing loops aren't optimized out

2019-04-14 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67809 Andrew Pinski changed: What|Removed |Added CC||gar...@ignition-web.co.uk --- Comment #6

[Bug middle-end/67809] Empty pointer-chasing loops aren't optimized out

2015-12-27 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67809 Andrew Pinski changed: What|Removed |Added Keywords||missed-optimization Status|U

[Bug middle-end/67809] Empty pointer-chasing loops aren't optimized out

2015-10-02 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67809 --- Comment #4 from Marc Glisse --- (In reply to Richard Biener from comment #3) > There isn't any "infinite loop is undefined behavior" thing > so clang removing the loop is an invalid transform. In C++ [intro.multithread] 27 The implementatio

[Bug middle-end/67809] Empty pointer-chasing loops aren't optimized out

2015-10-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67809 --- Comment #3 from Richard Biener --- We indeed do not have a flag to tell GCC it's ok to remove infinite loops with no side-effects. We assume the dereferences will not trap (unless -fexceptions -fnon-call-exceptions) and GCC happily removes p

[Bug middle-end/67809] Empty pointer-chasing loops aren't optimized out

2015-10-01 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67809 --- Comment #2 from Andrew Pinski --- And it is not legal to do if you catch other undefined behavior like trapping on invalid memory locations.

[Bug middle-end/67809] Empty pointer-chasing loops aren't optimized out

2015-10-01 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67809 Matt Godbolt changed: What|Removed |Added CC||matt at godbolt dot org --- Comment #1 fr