[net.lang.f77] F77 Optimization is broken

joey@reed.UUCP (Joe Pruett) (02/11/85)

	I would assume this has been hashed over before, but here we
go.  I have found lots of code that will get broken if I use -O to
f77.  OK, I can deal with a broken optimiser, I just pull out the
function that is getting trashed and don't use -O on it.  But while
trying to figure out what was going on in the assembly that was
breaking the code, I used -S to produce assembly and then used /lib/f2
to optimise it.  Suprise, this code is not the same as using -O.  So I
looked a little deeper and found that the 0th pass of the compiler
tries to do some optimizations.  Again, suprise, it's the one doing the
incorrect optimizations.  And again, suprise, the code produced by
using -S and /lib/f2 is smaller than the code produced by -O.  Why
is the world so screwed up?

To summarize the above paragraph.  When you use f77 -O to
compile, you'll often get incorrect object code.  If you use f77
-S and then use /lib/f2 on the .s file, you get correct code
that is smaller than the -O code.  Why?????

Responses of any kind appreciated.

	Joe Pruett
	Reed College
	...!tektronix!reed!joey