This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [egcs-19980531] Optimization bug persists


Quoting Hyman Rosen (hymie@prolifics.com):
> 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;
> }

It's funny, but if you change the line 
for (i = 1; i < 100; i++) to 
for (i = 0; i < 100; i++) 

everything is o.k. again.
Perhaps this helps to localize the bug.

-- 
Martin.

What is the difference between Jurassic Park and Microsoft?
One is an over-rated high tech theme park based on prehistoric 
information and populated mostly by dinosaurs, 
the other is a Steven Spielberg movie.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]