http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58454
Bug ID: 58454
Summary: Potentially wrong(or at least weird/inconsistent) code
generation with -O2 -fno-strict-overflow
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
All of these functions overflow the loop induction variable so only -fwrapv
will provide the behavior you want for all of the functions. The inconsistent
behavior is due to the overflows happening for induction variables. If it was
not an induction variable then -fno-strict-overflow would