[Bug c++/42810] Enumeration with sequential values has its for-loop exit condition optimized out.

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Jan 27 21:08:00 GMT 2010



------- Comment #19 from pinskia at gcc dot gnu dot org  2010-01-27 21:08 -------
Try:
#include <stdio.h>
main()
{
    for (signed char i = 1 ; i >= -2 ; i++)
    {
        printf( "%d ", i);
    }
}

The first one will never overflow the integer range as you have i <= 127 which
is always true with no overflow happening.


-- 


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



More information about the Gcc-bugs mailing list