[egcs-19980531] Optimization bug persists

Hyman Rosen hymie@prolifics.com
Tue Jun 2 15:49:00 GMT 1998


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;
}



More information about the Gcc-bugs mailing list