[comp.lang.fortran] I forget what it was originally called.

tada@athena.mit.edu (Michael Zehr) (03/06/88)

Back a week or so ago, there was a discussion about code like:

array1[i] = array2[i] = array3[i++];

and all the problems it's caused.  Well, I got nailed by that today (well,
yesterday actually, but i found out what was wrong today) using:

array[j] = array[j -=h];

Now, the interesting part is, I pulled the subroutine out of a personal
library of useful things, and it had been tested beforehand.  For some
strange reason, when it's an array of int, it works, but on other types
of arrays it doesn't work.  (I guess I shouldn't say work, but rather
"has the effect I want", because work implies that it's defined :-)

Anyway, this brought up a curious question: do compliers typically produce
code with different order of evaluation when compiling the same statements
but using different data types?  Can anyone point me to a good book that
outlines the different things optimizers try to do? 

Thanks in advance.


-------
michael j zehr
"My opinions are my own ... as is my spelling."