Xref: news-dnh.mv.net comp.os.msdos.djgpp:1612 Path: news-dnh.mv.net!mv!news.sprintlink.net!europa.chnt.gtegsc.com!cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!newsfeed.rice.edu!rice!news!sandmann From: Charles Sandmann Newsgroups: comp.os.msdos.djgpp Subject: Re: optimization.bug Date: Thu, 17 Aug 1995 07:43:35 CDT Organization: Rice University, Houston, Texas Lines: 10 References: Reply-To: sandmann AT clio DOT rice DOT edu Nntp-Posting-Host: clio.rice.edu To: djgpp AT sun DOT soe DOT clarkson DOT edu Dj-Gateway: from newsgroup comp.os.msdos.djgpp > With any of the optimizations selected, the 2nd while loop never terminates > as the busy bit always appears high. With no optimization the code works > as expected. Try to do a gcc -O2 -S on your code, then look at the GAS code generated. It is possible that the inlined port functions don't have enough of a "wait" between operations on that port, or GCC has optimized something away it should not have. If the assembly looks correct on the second loop which hangs, you can try to add some jmp 1f; 1: type statements to see if delays help. Step through it with the debugger.