gfortran compiler crash

John Harper John.Harper@mcs.vuw.ac.nz
Thu Nov 17 20:19:00 GMT 2005


The program below compiles and runs with 4 other f95 compilers (Compaq,
NAG, Sun, g95) so I suspect it's f95 standard-conforming. It uses none 
of the things specified in man gfortran
>In particular, there are known deficiencies with ENTRY,
>NAMELIST, and sophisticated use of MODULES, POINTERS and DERIVED TYPES.
but it caused gfortran to crash with an internal compiler error.

The program:

jabber:~/Jfh% cat testspeed.f90
INTEGER,PARAMETER::DP=KIND(1.0d0)
REAL(DP):: y(1000,1000),x(1000)=(/(i*7,i=1,1000)/)
tstart = 0.0
CALL timeit(6,' ',tstart,CPU)
DO i=1,1000
    y(:,i) = x**(1/3.d0)/i
END DO
PRINT*,'Check: y(10,100)=(70.**(1/3.)/100)?',y(10,100),70.d0**(1/3.d0)/100
CALL timeit(6,'y(:,i) stuff',tstart,CPU)
DO i = 1,1000
    y(i,:) = x**(1/3.d0)/i
END DO
PRINT*,'Check: y(100,10)=70.**(1/3.)/100)?',y(100,10),70.d0**(1/3.d0)/100
CALL timeit(6,'y(i,:) stuff',tstart,CPU)
END
   SUBROUTINE timeit(    iunit,stuff    ,tstart,CPU) ! Needs f95
     INTEGER,INTENT(IN)::iunit
     CHARACTER,INTENT(IN)::    stuff*(*)
     REAL,INTENT(INOUT)  ::              tstart
     REAL,INTENT(OUT)    ::                     CPU
! Make tstart = 0.0 before first call, and stuff = ' ' at the first call.
! Writes to iunit CPU time since last call if stuff non-blank and tstart
! is not altered outside timeit calls . The character string stuff should ! 
describe what has just been done after the first call.
     REAL tstop
     CALL CPU_TIME(tstop)
     CPU = tstop - tstart
     IF(TRIM(stuff)/='') WRITE(iunit,"(3A,F0.3,A)") &
          ' CPU time taken for ',stuff,' was ',CPU,' sec.'
     tstart = tstop
   END SUBROUTINE timeit

What happened at compile time:

jabber:~/Jfh% gfortran -v testspeed.f90
Driving: gfortran -v testspeed.f90 -lgfortranbegin -lgfortran -lm 
-shared-libgcc
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v 
--enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr 
--enable-shared --with-system-zlib --libexecdir=/usr/lib 
--without-included-gettext --enable-threads=posix --enable-nls 
--program-suffix=-4.0 --enable-__cxa_atexit --enable-libstdcxx-allocator=mt 
--enable-clocale=gnu --enable-libstdcxx-debug --enable-java-gc=boehm 
--enable-java-awt=gtk --enable-gtk-cairo 
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr 
--disable-werror --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.0.2 (Debian 4.0.2-2)
  /usr/lib/gcc/i486-linux-gnu/4.0.2/f951 testspeed.f90 -quiet -dumpbase 
testspeed.f90 -mtune=i486 -auxbase testspeed -version -o /tmp/ccUWaMnT.s
GNU F95 version 4.0.2 (Debian 4.0.2-2) (i486-linux-gnu)
         compiled by GNU C version 4.0.2 (Debian 4.0.2-2).
GGC heuristics: --param ggc-min-expand=90 --param ggc-min-heapsize=113003
testspeed.f90:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.0/README.Bugs>.

John Harper, School of Mathematics, Statistics and Computer Science,
Victoria University, PO Box 600, Wellington, New Zealand
e-mail john.harper@vuw.ac.nz phone (+64)(4)463 5341 fax (+64)(4)463 5045



More information about the Fortran mailing list