Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!bionet!agate!ucbvax!BRL.MIL!glennrp From: glennrp@BRL.MIL (Glenn Randers-Pehrson, TBD|WMB) Newsgroups: comp.sys.sgi Subject: Re: more IRIX 3.3.1 f77 -O2 bugs Message-ID: <9101141333.aa07911@TBD2.BRL.MIL> Date: 14 Jan 91 18:33:16 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: U.S. Army Ballistic Research Laboratory, APG, MD Lines: 53 Here's a complete example of one of the bugs I described recently. Hardware: IRIX 220GTX OS: IRIX 3.3.1 taylor.brl.mil> f77 -O1 inquirebug.f taylor.brl.mil> a.out # 8 is the correct answer 8 taylor.brl.mil> f77 -O2 inquirebug.f taylor.brl.mil> a.out # 19 is wrong 19 program inquirebug open(19) open(20) call inqbug end subroutine inqbug save logical exists,isopen,inuse integer inqfile data inqfile/19/ c find an available unit number isopen=.false. inquire(inqfile,exist=exists,err=70,iostat=junk) if(exists)inquire(inqfile,opened=isopen,err=70,iostat=junk) inuse=exists.and.isopen if(.not.inuse)go to 30 do 20 i=8,99 inqfile=i inquire(inqfile,exist=exists,err=70,iostat=junk) isopen=.false. if(exists)inquire(inqfile,opened=isopen,err=70,iostat=junk) inuse=exists.and.isopen if(.not.inuse)go to 30 20 continue write(*,*)' inqbug: No available unit.' go to 70 30 continue write(*,*)' inqbug: unit=',inqfile 65 close(inqfile,err=70) 70 continue return end The other program needs to be stripped down a bit more before I would feel comfortable sending it out. It's about 30K lines now. ...Glenn Randers-Pehrson