Implementing "restrict", and other alias questions
Toon Moene
toon@moene.indiv.nluug.nl
Sun Dec 28 06:34:00 GMT 1997
> 5. Are there any important missing aliasing optimizations
> in Fortran?
The basic rule in Fortran is: If you don't *tell* the compiler
there's overlap then it can assume there isn't. The only way to
tell the compiler about overlapping storage is via EQUIVALENCE.
So your question boils down to:
1. Does your alias analysis detect all forms of overlap due to the
use of the EQUIVALENCE construct, e.g.:
SUBROUTINE AAP
DIMENSION WIM(100), ZUS(100)
EQUIVALENCE (WIM(10), ZUS(20))
[ initialisation of ZUS ]
DO I = 1, 91
WIM(I) = ZUS(I+9) + 10.0
ENDDO
END
2. Two different local arrays cannot overlap (unless by EQUIVALENCE,
like above). Two different arrays in COMMON cannot overlap at all.
Does your alias analysis detect those cases ?
> (Moving stores out of loops doesn't count -- this is a
> loop optimizer deficiency.)
For those who don't know the context of this remark - I came across
this deficiency while looking for code on which John's alias
analysis would be a win, so naturally I thought that the inability
of g77 to move stores to loop-constant addresses out of the loop was
related to alias analysis - however, John pointed out to me that
the current loop optimisation pass doesn't do this at all.
Toon.
More information about the Gcc
mailing list