From: Nate Eldredge Newsgroups: comp.os.msdos.djgpp Subject: Re: Compiler optimization bug Date: 12 Dec 1999 13:48:09 -0800 Organization: InterWorld Communications Lines: 24 Message-ID: <831z8romp2.fsf@mercury.st.hmc.edu> References: <830aq2$68s$1 AT news-int DOT gatech DOT edu> <830j66$is$1 AT nntp6 DOT atl DOT mindspring DOT net> NNTP-Posting-Host: mercury.st.hmc.edu X-Trace: nntp1.interworld.net 945035364 54973 134.173.45.219 (12 Dec 1999 21:49:24 GMT) X-Complaints-To: usenet AT nntp1 DOT interworld DOT net NNTP-Posting-Date: 12 Dec 1999 21:49:24 GMT X-Newsreader: Gnus v5.7/Emacs 20.4 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Marp" writes: > Robert Ruehlmann wrote in message > news:830aq2$68s$1 AT news-int DOT gatech DOT edu... > > I think I've found a bug in the DJGPP compiler (gcc 2.95.2). When > optimized > > with -O2 the following small sample program goes into an infinite loop. > > Debugging with gdb shows strange behaviour like modifications of the > 'size' > > variable. > > > > <-- cut here --> > > static void bug(int size, int tries) > > try changing this line to this instead: > > static void bug(volatile int size, int tries) That's a workaround, not a fix. -- Nate Eldredge neldredge AT hmc DOT edu