This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Optimization Question


On Mon, 26 Jul 1999, Richard Henderson wrote:

> On Mon, Jul 26, 1999 at 05:55:10PM -0700, Andy Vaught wrote:
> >   This sort of optimization is prohibited by the f90/95 spec for a good
> > reason ...
> 
> Actually, Fortran merely prohibits reassociation across parenthesis.
> 

  Oops, I should have said that the distributive law doesn't hold. 
Associativity, (a+b)+c=a+(b+c) and a*(b*c) = (a*b)*c, don't hold either.
These failings are why a compiler should not reorder such expressions. 

      Andy

-----------------                        XOLD(K,IC,I)=
Andy Vaught               ....        DO ITERS=1, 10  XOLD(K,IC,I)
andy@maxwell.la.asu.edu   |  |   /CALLMSOLVE(A,B,X,I,ITERS,TOL)+(RANNYU(0)
Arizona State University  ======|WRITE(6,'(I5,2X,F12.6)')ITERS,TOL -HALF)
Tempe, Arizona USA        OOOOOO \ENDDORETURN PARAMETER(ZERO=1.D0)*TENTH*DELTA




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]