The following Fortran 90 program crashes gfortran-4.2.1: program test real(kind=8),parameter :: beta0(3) = (/ 1.0, 1.0, 1.0 /) integer :: i(3) real(kind=8) :: beta(3), beta_coef i = (/ 1, 2, 3 /) beta_coef = 1.0 beta = beta0(i) * beta_coef end program test (Workaround: "beta = beta0(i) ; beta = beta * beta_coef") Compiler output: $ gfortran -g -O2 -march=pentium4 -mfpmath=sse -ffree-form -ffree-line-length-none -Wall -W -Wno-unused -Wimplicit-interface -Wtabs -fimplicit-none -ffpe-trap=invalid,zero,overflow -o arraybug arraybug.f90 arraybug.f90:0: internal compiler error: in find_array_section, at fortran/expr.c:1079 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. $ gfortran -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../gcc-4.2.1/configure --prefix=/home/r6144/apps/gcc-4.2.1 --enable-languages=c,fortran --with-mpfr=/home/r6144/apps/mpfr-2.3.0 --disable-bootstrap Thread model: posix gcc version 4.2.1 $ gfortran --version GNU Fortran (GCC) 4.2.1 Copyright (C) 2007 Free Software Foundation, Inc. GNU Fortran comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GNU Fortran under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING
Could you try with GCC gfortran 4.3.0? I can reproduce the problem with gfortran 4.2.x but not with gfortran 4.3.0 which indicates that this has been fixed meanwhile. If you don't want to build GCC yourself (as you seem to do), you can use the binaries from http://gcc.gnu.org/wiki/GFortranBinaries
Thank you. The bug appears to have been fixed in the latest 4.3.0 snapshot (r128023).
Unless this is a regression, won't be fixed.