This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [patch, fortran] Fix PR 36931, more array dependencies
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