This is the mail archive of the gcc-bugs@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: [Bug fortran/16511] New: Test 19990905-0.f fails with gfortran


billingd at gcc dot gnu dot org wrote:
g77 test 19990905-0.f fails with gfortran.

The test is

c { dg-do compile }
* =foo0.f in Burley's g77 test suite.
      subroutine sub(a)
      common /info/ iarray(1000)
      equivalence (m,iarray(100)), (n,iarray(200))
      real a(m,n)
      a(1,1) = a(2,2)
      end

In file /usr/local/src/gcc/gcc/testsuite/gfortran.dg/g77/19990905-0.f:6

      real a(m,n)
            1
Error: Variable 'm' cannot appear in the expression at (1)

According to Steve Kargl:

Ftnchek says its legal Fortran 77.

That can't be true, because it isn't - my take on it is that ftnchek simply doesn't recognise the issues.


m is equivalenced to an item in common. That makes `real a(m,n)' a declaration of an automatic array, which is a Fortran 90 beast (it didn't exist in Fortran 77)

However, to me it looks like a valid (though complicated) way to define such a thing.

Hope this helps,

--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/


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