This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/16511] Test 19990905-0.f fails with gfortran
- From: "billingd at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jul 2004 23:22:42 -0000
- Subject: [Bug fortran/16511] Test 19990905-0.f fails with gfortran
- References: <20040713055437.16511.billingd@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From billingd at gcc dot gnu dot org 2004-07-15 23:22 -------
After following the discussion on c.l.f (thanks Steve) it seems 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
--
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2004-07-14 01:13:07 |2004-07-15 23:22:42
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16511