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 Monday 28 June 2004 18:25, Robert Dewar wrote:
> Dale Johannesen wrote:
> >> 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
>
> isn't it the case that the above is wrong even if there is no
> reference to b.

Correct. The code would still be illegal if the print statement were removed.

> I know that at least in earlier versions of 
> Fortran, the error occurs at the point where you do an assignment
> to a variable which has a visible alias.

Yes.
Obviously the visibility of the alias only effects the ability of the compiler 
to give an error, not the legality of the code.

Paul


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