-falias and -ffnalias

-falias and -ffnalias

I'm finding the documentation on the -falias and -ffnalias rather unclear.

The standard prohibits aliasing of a dummy argument which is modified either to another dummy argument or to a module or common variable. According to the manual "-falias" to quote
"assumes aliasing". Does this mean that it assumes aliasing which does conform to the standard (for example the same array passed to two distinct INTENT(IN) arguments) or that the compiler can not assume the rules of the standard are followed by the program. And since the default is ON does this mean that the compiler is under-optimising standard-compliant programs by default?

In other words, is it (a) safe and (b) likely to improve performance by specifying -fno-alias on a standard-conforming program?

Finally, am I correct in guessing that -ffnalias refers to subroutine dummy arguments only but that -falias also includes aliasing by pointers?

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

You raise an interesting question - one I don't know the answer to offhand. I will investigate and find out.

You are correct that Fortran, unlike C, has language rules that generally prohibit aliasing - or more precisiely, prohibit writing a program that could be affected by aliasing. (The rules are more complex in Fortran 90 and 95 than in F77.)

Compaq Fortran has had an "assume [no]dummy_aliases" option with a default of "assume there are no aliases". Specifying "assume dummy_aliases" disables some optimizations.


Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today