[Bug c/60527] Incorrectly removed if statement while doing int arithmetics

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Mar 14 16:09:00 GMT 2014


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
You have an integer overflow in your code which is why the comparisons are
being removed.

if (tmp == INT_MIN)

Can never happen because B is always a positive constant (411), so tmp has a
range of [INT_MIN+411. INT_MAX].  The only way to get INT_MIN is if you had an
overflow and overflows in C are undefined.



More information about the Gcc-bugs mailing list