g77 bug

David Serafini dbs@n2001.lbl.gov
Tue Feb 16 22:15:00 GMT 1999


egcs-19990124 g77

Here's the code and error message:

!------------------------------------------
      subroutine foo(a,d)
      implicit none
      integer d(3)
      real a(d(1),d(2),d(3))
      a(1,1,1) = 0.0
      return
      end

!------------------------------------------
! n2001 875> eg77 -c eg77-arraydecl.f 
! eg77-arraydecl.f: In subroutine `foo':
! eg77-arraydecl.f:1: 
! 	   subroutine foo(a,d)
! 			    1
! eg77-arraydecl.f:4: (continued):
! 	   real a(d(1),d(2),d(3))
! 		  2
! Invalid declaration of or reference to symbol `d' at (2) [initially seen at (1)]
! eg77-arraydecl.f:1: 
! 	   subroutine foo(a,d)
! 			  1
! eg77-arraydecl.f:5: (continued):
! 	   a(1,1,1) = 0.0
! 	   2
! Invalid declaration of or reference to symbol `a' at (2) [initially seen at (1)]
!------------------------------------------

Every other Fortran compiler I know accepts this code (it's from the NAS parallel
benchmark suite, so every major high end vendor has compiled this).
I haven't gone digging in the standard to be sure the code is correct,
but if it's not standard, g77 should accept it as an extension.

Here's the g77 -v output:

n2001 876> eg77 -v
g77 version egcs-2.93.03 19990124 (gcc2 ss-980609 experimental) (from FSF-g77 version 0.5.24-19980804)
Driving: eg77 -v -c -xf77-version /dev/null -xnone
Reading specs from /usr/local/pkg/egcs-19990124/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.93.03/specs
gcc version egcs-2.93.03 19990124 (gcc2 ss-980609 experimental)
 /usr/local/pkg/egcs-19990124/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.93.03/cpp -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=93 -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D_LANGUAGE_FORTRAN -traditional -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ /dev/null /dev/null
GNU CPP version egcs-2.93.03 19990124 (gcc2 ss-980609 experimental) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/pkg/egcs-19990124/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.93.03/../../../../i686-pc-linux-gnu/include
 /usr/local/pkg/egcs-19990124/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.93.03/include
 /usr/include
End of search list.
 /usr/local/pkg/egcs-19990124/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.93.03/f771 -fnull-version -quiet -dumpbase g77-version.f -version -fversion -o /tmp/cc0ThTkQ.s /dev/null
GNU F77 version egcs-2.93.03 19990124 (gcc2 ss-980609 experimental) (i686-pc-linux-gnu) compiled by GNU C version egcs-2.93.03 19990124 (gcc2 ss-980609 experimental).
GNU Fortran Front End version 0.5.24-19980804
 as -V -Qy -o /tmp/ccqIKumx.o /tmp/cc0ThTkQ.s
GNU assembler version 2.9.1 (i686-pc-linux-gnu), using BFD version 2.9.1.0.15
 ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o /tmp/ccSLSTef /tmp/ccqIKumx.o /usr/lib/crt1.o /usr/lib/crti.o /usr/local/pkg/egcs-19990124/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.93.03/crtbegin.o -L/usr/local/pkg/egcs-19990124/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.93.03 -L/usr/local/pkg/egcs-19990124/lib -lg2c -lm -lgcc -lc -lgcc /usr/local/pkg/egcs-19990124/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.93.03/crtend.o /usr/lib/crtn.o
 /tmp/ccSLSTef
__G77_LIBF77_VERSION__: 0.5.24
@(#)LIBF77 VERSION 19970919
__G77_LIBI77_VERSION__: 0.5.24-19980920
@(#) LIBI77 VERSION pjw,dmg-mods 19980617
__G77_LIBU77_VERSION__: 0.5.24
@(#) LIBU77 VERSION 19980709


More information about the Gcc-bugs mailing list