more IRIX 3.3.1 f77 -O2 bugs
Glenn Randers-Pehrson, TBD|WMB
glennrp at BRL.MIL
Tue Jan 15 05:33:16 AEST 1991
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 <glennrp at brl.mil>
More information about the Comp.sys.sgi
mailing list