This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: proposal for compilation unil wide alias analyis


On Jun 28, 2004, at 4:58 AM, Paul Brook wrote:
On Monday 28 June 2004 12:44, Mircea Namolaru wrote:
We started to implement IPA constant propagation
(see http://gcc.gnu.org/ml/gcc/2004-06/msg00518.html) and also look into
some related IPA alias analysis issues.


As we understand it, your proposal targets static variables only.
Extending
the analysis to reference formal arguments may detect aliasing introduced
by
parameter passing (in Fortran this is the only way two variables can
alias).

No they can't. Aliasing of variables through procedure arguments is prohibited
by the standard.


For example the following program is illegal:

subroutine foo (a, b)
  integer a, b
  ! This invokes undefined behaviour if the same actual argument
  ! is passed for a and b
  a = 1
  print *, b
end subroutine

program illegal
  integer i
  call foo (i, i)
end program

This property is abstracted as -fargument-noalias-global (set by Fortran),
which aliasing code can look at.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]