[Bug tree-optimization/110129] Possible wrong-code on -O2 and above (affecting versions from GCC-10.1 onward)
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jun 5 15:58:44 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110129
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Ever confirmed|0 |1
Last reconfirmed| |2023-06-05
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So in C++, it is required that forward process happens so GCC (due to the
-ffinite-loops option which is only enabled for -O2 and above) will remove
infinite loops for C++.
Now your goldbolt link is using the C++ front-end while your comment says using
C front-end.
Once I change goldbolt to using C sources, the infinite loop is NOT removed as
expected (as -ffinite-loops is only enabled for C++).
More information about the Gcc-bugs
mailing list