http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50922
--- Comment #2 from Mikael Pettersson <mikpe at it dot uu.se> 2011-10-30 17:03:10 UTC --- (In reply to comment #0) > int main(void) > { > long x=0; > unsigned long c; > for(c=0;c<2147483648UL;c++) > { > lcdSendData(x++); > } You're causing a signed overflow in the "x++" expression. Try making x "unsigned long" instead. Or pass "-fwrapv" to gcc.