Egcs continues to have this optimization bug. It appears in both places I've tried, Linux and Solaris. The following code should print "OK". When compiled with -O2 or better, it prints nothing. int main(int c, char **v) { extern int printf(char *, ...); int i; for (i = 1; i < 100; i++) ; if (i == 100) printf("OK\n"); return 0; }