This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: Testsuite patch for PR fortran/16511
- From: "Billinghurst, David (CALCRTS)" <david dot billinghurst at comalco dot riotinto dot com dot au>
- To: <gcc-patches at gcc dot gnu dot org>
- Cc: <fortran at gcc dot gnu dot org>
- Date: Fri, 16 Jul 2004 08:55:25 +1000
- Subject: RE: Testsuite patch for PR fortran/16511
David Billinghurst wrote:
> I now think the current gfortran behaviour is standard conforming.
> See the PR for discussion.
>
> OK to commit.
>
> 2004-07-14 David Billinghurst (David.Billinghurst@riotinto.com)
>
> PR fortran/16511
> * gfortran.dg/g77/19990905-0.f: Add dg-error. Remove xfail
> * gfortran.dg/g77/README: Update
>
After following the discussion on c.l.f (thanks Steve) I withdraw this
patch, as the code in question "clearly" (?) conforms to F90 standard.
Richard Maine wrote:
Date: 14 Jul 2004 08:16:06 -0700
Klaus Wacker <wacker@physik.uni-dortmund.de> writes:
> I think it could have already been legal in Fortran 77. As the array
> is passed in as an argument, no dynamic memory allocation is
> necessary. However, the standard says:
>
> | A variable name that appears in a dimension bound expression of an
> | array must also appear as a name either in every dummy argument list
> | that contains the array name or in a common block in that subprogram.
>
> The phrase "as a name" seems to exclude the association to a common
> via equivalence.
I find that phrase a little strange in general. After all, a name
isn't in a common block. A name is in a common statement, but not
a common block. I'd be tempted to interpret that as the variable
being in the common block. But I guess I don't find it definitive.
The f90 standard is a little more clear here. The corresponding
requirement for a specification expression is
"A variable that is in a common block or a variable that is the subobject
of a variable in a common block."
No funniness about names being in common blocks. I'd say that the
equivalenced variable is probably alsso "in" the common block,
though the precise definition of common blocks is tricky indeed
(I'm occasionally amazed at the people who mention how simple
common is - I think they mostly don't understand its real definition,
but only how simple it can be if you restrict yourself to simple
use of it...which isn't a bad idea). Hmm... Ah. I'm slighly surprised,
but I do manage to find the words to cover this pretty much in exactly
the form needed. F90 5.5.2.1(2)
"Data objects associated with an entity in a common block are considered
to be in that common block."
So I think I'll go with "clearly" legal in f90, but subject to debate
in f77. Since you aren't going to get a formal f77 interp any more,
that's probably how it will have to stand