The following testcase gives an internal compiler error with both gfortran 4.0.2 and gfortran 4.1.0 20051015:
module crash implicit none type foo integer :: i = 0 type (foo), pointer :: next end type foo type (foo), save :: bar end module crash Remove the default initialization with 0 and it compiles just fine. (Remove the pointer declaration in the derived type and it compiles fine. Remove the declaration of variable bar and it compiles fine.) It reminds me a bit of bug 16606, but is different as the compiler crashes. Test case compiles fine with ifort Version 9.0 Build 20050809Z, G95 (GCC 4.0.1 (g95!) Oct 16 2005). -- gfortran 4.1 20051015 output: -- % /usr/local/gcc-4.1-20051015/bin/gfortran -v -save-temps -c bug-gfortran-4.1.f90 Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../gcc-4.1-20051015/configure --enable-shared --prefix=/usr/local/gcc-4.1-20051015 --enable-languages=c,c++,fortran --enable-threads --enable-__cxa_atexit Thread model: posix gcc version 4.1.0 20051015 (experimental) /usr/local/gcc-4.1-20051015/libexec/gcc/i686-pc-linux-gnu/4.1.0/f951 bug-gfortran-4.1.f90 -quiet -dumpbase bug-gfortran-4.1.f90 -mtune=pentiumpro -auxbase bug-gfortran-4.1 -version -o bug-gfortran-4.1.s GNU F95 version 4.1.0 20051015 (experimental) (i686-pc-linux-gnu) compiled by GNU C version 4.1.0 20051015 (experimental). GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 bug-gfortran-4.1.f90:0: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. -- gfortran 4.0.2 output: -- /usr/local/gcc-4.0.2/bin/gfortran -v -save-temps -c bug-gfortran-4.1.f90 Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../gcc-4.0.2/configure --enable-shared --prefix=/usr/local/gcc-4.0.2 --enable-languages=c,c++,f95 --enable-threads --enable-__cxa_atexit Thread model: posix gcc version 4.0.2 /usr/local/gcc-4.0.2/libexec/gcc/i686-pc-linux-gnu/4.0.2/f951 bug-gfortran-4.1.f90 -quiet -dumpbase bug-gfortran-4.1.f90 -mtune=pentiumpro -auxbase bug-gfortran-4.1 -version -o bug-gfortran-4.1.s GNU F95 version 4.0.2 (i686-pc-linux-gnu) compiled by GNU C version 4.0.2. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 bug-gfortran-4.1.f90:0: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. Environment: System: Linux antares 2.6.8-24.17-bigsmp #1 SMP Tue Jul 19 08:56:33 UTC 2005 i686 unknown unknown GNU/Linux Architecture: i686 Linux 2.6.8-24.17-bigsmp glibc 2.3.4 SuSE 9.2 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu % cat /proc/cpuinfo | grep "model name" model name : AMD Opteron(tm) Processor 250 -- Summary: gfortran ICE for valid derived type definition with default initialization Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: critical Priority: P2 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sven dot buijssen at math dot uni-dortmund dot de GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24426