http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49472
Summary: [gfortran, 4.7 regression] Compiler segfault on valid code Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: mar...@mpa-garching.mpg.de When trying to compile the code below with gfortran 4.7 and a specific set of flags, the compiler segfaults: /scratch/martin/tmp/planck/lsclean>gfortran -v -g -O -ffast-math -c CAMB/modules.f90 Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/afs/mpa/data/martin/ugcc/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /scratch/martin/gcc/configure --disable-bootstrap --disable-graphite --enable-gold --enable-plugins --prefix=/afs/mpa/data/martin/ugcc --with-libelf=/afs/mpa/data/martin/numlibs64 --enable-languages=c++,fortran --enable-target=all --enable-checking=release Thread model: posix gcc version 4.7.0 20110620 (experimental) [trunk revision 175202] (GCC) COLLECT_GCC_OPTIONS='-v' '-g' '-O' '-ffast-math' '-c' '-mtune=generic' '-march=x86-64' /afs/mpa/data/martin/ugcc/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/f951 CAMB/modules.f90 -quiet -dumpbase modules.f90 -mtune=generic -march=x86-64 -auxbase modules -g -O -version -ffast-math -fintrinsic-modules-path /afs/mpa/data/martin/ugcc/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/finclude -o /tmp/ccHb3jKV.s GNU Fortran (GCC) version 4.7.0 20110620 (experimental) [trunk revision 175202] (x86_64-unknown-linux-gnu) compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU Fortran (GCC) version 4.7.0 20110620 (experimental) [trunk revision 175202] (x86_64-unknown-linux-gnu) compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 gfortran: internal compiler error: Segmentation fault (program f951) Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. The code compiles without complaint with gfortran 4.5.2 and the head of the 4.6 branch. module MassiveNu implicit none private integer, parameter :: dl = KIND(1.d0) real(dl), dimension(:), allocatable :: r1,p1,dr1,dp1,ddr1,qdn real(dl), parameter :: dq=1._dl integer, parameter :: nqmax0=15 !number of q to sample for each l integer nqmax contains subroutine Nu_derivs(am,adotoa,rhonu,rhonudot,shearnudot,psi2,psi2dot) real(dl) psi2(nqmax0),psi2dot(nqmax0) real(dl) g1(nqmax0+1) real(dl) adotoa,rhonu,rhonudot,shearnudot real(dl) aq,q,v,d,aqdot,vdot,g0 real(dl), intent(IN) :: am integer iq do iq=2,(nqmax0+1) q=(iq-1.5d0)*dq aq=am/q aqdot=aq*adotoa v=1._dl/sqrt(1._dl+aq*aq) vdot=-aq*aqdot/(1._dl+aq*aq)**1.5d0 g1(iq)=qdn(iq-1)*(psi2dot(iq-1)*v+psi2(iq-1)*vdot) end do call splint(g1,g0,nqmax0+1) end subroutine Nu_derivs end module MassiveNu