[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Aliasing and Garbage Collection



On Thu, 19 Oct 2000, Oyvind Teig wrote:

>   Fortran does not allow aliasing, but how is it enforced?

It isn't.
 
>   The word "alias" does not appear in the official X3J3/90.4 
>   Fortran specification:
>     http://www.fortran.com/fortran/stds_docs.html
>     http://www.fortran.com/fortran/F77_std/rjcnf.html 

It's all there, you just have to get to know FORTRAN-speak:

15.9.3.6 Restrictions on Association of Entities.

If a subprogram reference causes a dummy argument in the referenced
subprogram to become associated with another dummy argument in the
referenced subprogram, neither dummy argument may become defined during
execution of that subprogram. For example, if a subroutine is headed by 

      SUBROUTINE XYZ (A,B)

and is referenced by 

      CALL XYZ (C,C)

then the dummy arguments A and B each become associated with the same
actual argument C and therefore with each other. Neither A nor B may
become defined during this execution of subroutine XYZ or by any
procedures referenced by XYZ. 

If a subprogram reference causes a dummy argument to become associated
with an entity in a common block in the referenced subprogram or in a
subprogram referenced by the referenced subprogram, neither the dummy
argument nor the entity in the common block may become defined within
the subprogram or within a subprogram referenced by the referenced
subprogram. For example, if a subroutine contains the statements: 

      SUBROUTINE XYZ (A)
      COMMON C

and is referenced by a program unit that contains the statements: 

      COMMON B
      CALL XYZ (B)

then the dummy argument A becomes associated with the actual argument B,
which is associated with C, which is in a common block. Neither A nor
C may become defined during execution of the subroutine XYZ or by any
procedures referenced by XYZ.

>   Did occam compiler writers reuse the Fortran algorithms in
>   any way?

Probably not in the way you mean. We do use algorithms (and code) 
orignally developed for FORTRAN in SPoC's usage checker. 

Denis A Nicole                 WWW:   http://www.hpcc.ecs.soton.ac.uk/~dan
High Performance Computing     Email: dan@xxxxxxxxxxxxxxx
Department of Electronics      Phone: +44 23 8059 2703
       & Computer Science      Fax:   +44 23 8059 3903
University of Southampton
SO17  1BJ
United Kingdom