------- Comment #4 from pinskia at gcc dot gnu dot org 2010-06-14 07:35 ------- > if ((unsigned int)(xCount + 32) < 0x80000000)
Yes even though the comparision is done in an unsigned type, the addition is done in a signed type which means the overflow of that addition is undefined. So changing the code to be: if (((unsigned int)xCount) + 32u < 0x80000000u) Will fix the issue or use -fwrapv. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44530