[Bug other/95971] [10 regression] Optimizer converts a false boolean value into a true boolean value

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 29 18:27:42 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95971

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|WAITING                     |RESOLVED

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
All right, so it's caused by cdde1:

Assume loop 1 to be finite: it has an exit and -ffinite-loops is on.

       -ffinite-loops
           Assume that a loop with an exit will eventually take the exit and
not loop indefinitely.  This allows the compiler to remove loops that otherwise
have no side-effects, not considering eventual endless looping as such.

           This option is enabled by default at -O2 for C++ with -std=c++11 or
higher.


More information about the Gcc-bugs mailing list