proposal for compilation unil wide alias analyis
Paul Brook
paul@codesourcery.com
Mon Jun 28 18:10:00 GMT 2004
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
More information about the Gcc
mailing list