This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [egcs-19980531] Optimization bug persists
- To: Hyman Rosen <hymie at prolifics dot com>
- Subject: Re: [egcs-19980531] Optimization bug persists
- From: Martin Kahlert <martin dot kahlert at mchp dot siemens dot de>
- Date: Wed, 3 Jun 1998 08:41:27 +0200
- Cc: egcs-bugs at cygnus dot com
- References: <199806022249.SAA17536@calumny.jyacc.com>
- Reply-To: martin dot kahlert at mchp dot siemens dot de
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.