[patch, fortran] Fix PR 36931, more array dependencies

Thomas Koenig tkoenig@netcologne.de
Sat Sep 4 21:12:00 GMT 2010


Hi Steven,

> On Sat, Sep 4, 2010 at 12:58 AM, Thomas Koenig <tkoenig@netcologne.de> wrote:
> > Hello world,
> >
> > here a few more temporary eliminations, for code like
> >
> >  a = f() + b
> 
> 
> So what happens with "a = f() + g() + h" e.g. a = matmul(b,c) +
> matmul(d,e) + f" ?
> 

In the first step, this is converted to

a = matmul(b,c)
a = a + matmul(d,e) + f

When optimize_assignment looks at the second statement again,
gfc_check_dependency finds the dependency between the lhs and
rhs, and the optimization is not run again.

When you look at the patch, the difference is easy to spot in the
*.original file with and without -O (because this part is run only
with optimization).

	Thomas




More information about the Fortran mailing list