[Bug regression/59320] ftree-vrp breaks simple loops

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Nov 29 08:10:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59320

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That is simple, accessing out of bounds element is undefined behavior and the
compiler may optimize based on the fact that undefined behavior does not
happen.
As the upper bound is not constant, no warning is emitted on it, the compiler
just assumes that in a valid program nd must be < 2 before entering the loop.



More information about the Gcc-bugs mailing list