This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Optimization Question
- To: Richard Henderson <rth at cygnus dot com>
- Subject: Re: Optimization Question
- From: Andy Vaught <andy at maxwell dot la dot asu dot edu>
- Date: Mon, 26 Jul 1999 22:43:05 -0700 (MST)
- Cc: gcc at gcc dot gnu dot org
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