[Bug c/58454] New: Potentially wrong(or at least weird/inconsistent) code generation with -O2 -fno-strict-overflow

2013-09-17 Thread mednafen at gmail dot com
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

Re: [Bug c/58454] New: Potentially wrong(or at least weird/inconsistent) code generation with -O2 -fno-strict-overflow

2013-09-17 Thread pinskia
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