g77 negative array bound on x86 Linux

Craig Burley burley@gnu.org
Wed Apr 1 21:12:00 GMT 1998


>      SUBROUTINE DAFAH (
>     &                   www
>     &  )
>  
>      INTEGER               LBCELL
>      PARAMETER           ( LBCELL  = -5 )
> 
>      INTEGER               www ( LBCELL : *)
>
>      END
>
>and the error from "g77 -c x.f":
>
>x.f: In subroutine `dafah':
>x.f:2: 
>        .                   www
>                            ^
>Array `www' at (^) is too large to handle
>Exit 1
>
>This code used to compile with an older version of g77 (not from egcs).
>I've been told that this is valid FORTRAN code.  Could someone please
>explain what may be wrong or if this is an egcs/g77 bug?

It doesn't look to me like a bug in your code.  (Although I do wonder
how the `&' in the source code got displayed as a `.' in the
diagnostic. ;-)

There have been changes in egcs/g77 lately designed to try to cope
with assumed-size arrays (like `www' in your code) while also
providing useful diagnostics regarding overly large arrays, etc.

I don't know what version of egcs you're using (I'd guess 1.0.1 or
1.0.2), but 1.0.1 has the bug you reported, while the egcs snapshot
dated 1998-03-21 does not have the bug.

So, probably egcs 1.1 will fix this bug when it comes out.

        tq vm, (burley)



More information about the Gcc-bugs mailing list