[net.lang.f77] Errors in f77 -O option

winston@cubsvax.UUCP (Ken Winston) (03/05/86)

It is well know that there are bugs in the optimizer in the f77
compiler (ours is on MicroVax II ULTRIX). I have seen various scary
warnings about these errors, but no actual list. I was beginning to
think the whole thing was overblown when I ran into one the hard way
(I only lost a day tracking it down).

Does anybody have a list of the -O problems on f77? Which ones (if any)
are fixed in the new version of f77?

Here is a program that acts differently when compiled with/without -O.
The "0." gets a little too optimized in the write statement, and
disappears altogether.

	dimension array(20)
	open (1,file='binar',access='direct',recl=80)
	do 10 i=1,10
10	array(i)=i
	write(1,rec=1) (array(i),0.,i=1,10)
	close (1)
	open (1,file='binar',access='direct',recl=80)
	read(1,rec=1) array
	write(6,*) array
	stop
	end

Ken Winston				Winston Capital Systems, Inc.
...{cmcl2,rna,cubsvax}!wealth!ken	250 West 75th Street, Suite 3A
+1-212-382-3450				New York, New York  10023-1757