This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [gfortran] Fix NULL reference types.
- From: Paul Brook <paul at codesourcery dot com>
- To: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Fri, 20 Aug 2004 22:25:09 +0100
- Subject: Re: [gfortran] Fix NULL reference types.
- Organization: CodeSourcery
- References: <10408191754.AA27453@vlsi1.ultra.nyu.edu> <200408200126.59865.paul@codesourcery.com> <4126664B.8090805@moene.indiv.nluug.nl>
[rearranging the CC list a bit]
> Now, given that this is illegal, an adventurous Fortran compiler
> engineer (e.g., X maintaining gfortran fifteen years after you have
> abandoned it), might turn:
>
> subroutine sub1(a, b)
> intent(in) :: a
> intent(out) :: b
> if (a > 0) b = log(a)
> end
>
> into:
>
> subroutine sub1(a, b)
> intent(in) :: a
> intent(out) :: b
> real c
> if (a > 0) c = log(a)
> b = c
> end
Yes, I agree that this is the case for intent(out) variables.
Does the same apply if the intent is _not_ specified.
ie. is the following program legal?
subroutine sub1(a, b)
if (a > 0) b = log(a)
end
program prog
integer i, j
call sub1(0, 0)
i = 1
call sub1(i, j)
end program
Does the fact that b is redefined on some invocations of sub1 imply that every
actual argument associated with b must be definable?
Paul