Fortran aliasing in tree-ssa-alias.c (may_alias_p).

Toon Moene toon@moene.indiv.nluug.nl
Sat Mar 11 12:49:00 GMT 2006


Diego,

In Fortran the pointer that is constructed as part of gfortran's 
implementation of pass-by-reference, cannot point to *anything* else 
than the argument itself.

Therefore, I think that the attached patch is more correct than the 
original code, which only asserted that it cannot point to any global 
variable.

This solves the vectorization of:

       SUBROUTINE S(A, B, N)
       DIMENSION A(N), B(N)
       READ*,Z
       DO I = 1, N
          A(I) = Z * B(I)
       ENDDO
       END

Previously, the loop could not be vectorized because the compiler 
couldn't prove that (the pointer associated with dummy argument) A 
cannot point to Z (correctly analysed by Andrew P. and Dorit).

Bootstrapped and make -k check-fortran'd without regression; ran a few 
HIRLAM cycles using it with no adverse effects.

OK for mainline ?

-- 
Toon Moene - e-mail: toon@moene.indiv.nluug.nl - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/
My next laptop will have a crank
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tree-alias.patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060311/fd573e7d/attachment.ksh>


More information about the Gcc-patches mailing list