The following code generates an internal compiler error on gcc 4.2.3 on x86_64-linux-gnu
Bug: The following bug occurs when: -The designated variables are stored in the module -Multithreading is applied -The final subroutine is called from another subroutine Command-line: gfortran -v -save-temps -g -fopenmp mH_Junctions.f90 Lanczos.f90 -o _Lanczos Compiler output: Driving: gfortran -v -save-temps -g -fopenmp mH_Junctions.f90 Lanczos.f90 /usr/lib/liblapack-3.so -o _Lanczos -lgfortranbegin -lgfortran -lm -shared-libgcc Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7) /usr/lib/gcc/x86_64-linux-gnu/4.2.3/f951 mH_Junctions.f90 -quiet -dumpbase mH_Junctions.f90 -mtune=generic -auxbase mH_Junctions -g -version -fopenmp -fstack-protector -I /usr/lib/gcc/x86_64-linux-gnu/4.2.3/finclude -o mH_Junctions.s GNU F95 version 4.2.3 (Ubuntu 4.2.3-2ubuntu7) (x86_64-linux-gnu) compiled by GNU C version 4.2.3 (Ubuntu 4.2.3-2ubuntu7). GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 as --traditional-format -V -Qy -o mH_Junctions.o mH_Junctions.s GNU assembler version 2.18.0 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.18.0.20080103 /usr/lib/gcc/x86_64-linux-gnu/4.2.3/f951 Lanczos.f90 -quiet -dumpbase Lanczos.f90 -mtune=generic -auxbase Lanczos -g -version -fopenmp -fstack-protector -I /usr/lib/gcc/x86_64-linux-gnu/4.2.3/finclude -o Lanczos.s GNU F95 version 4.2.3 (Ubuntu 4.2.3-2ubuntu7) (x86_64-linux-gnu) compiled by GNU C version 4.2.3 (Ubuntu 4.2.3-2ubuntu7). GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Lanczos.f90:26: 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.2/README.Bugs>. mh_Junctions.f90: MODULE Parameters IMPLICIT NONE INTEGER, parameter :: dbl = 8 INTEGER(kind=dbl), parameter :: g_junct = 6 INTEGER(kind=dbl), parameter :: g_dims = 6 INTEGER(kind=dbl) :: g_alpha(g_dims,g_junct) END MODULE Parameters Lanczos.f90: PROGRAM Lanczos use parameters IMPLICIT NONE call Algorithm() STOP CONTAINS SUBROUTINE Algorithm() use parameters IMPLICIT NONE CALL ConstructH() END SUBROUTINE Algorithm SUBROUTINE ConstructH() use omp_lib use parameters IMPLICIT NONE INTEGER(kind=dbl) :: g_Ndim = 7 INTEGER(kind=dbl) :: ni, N(g_dims), M(g_dims), l !$OMP PARALLEL DEFAULT(NONE) & !$OMP SHARED(g_alpha,g_ndim, g_junct) & !$OMP PRIVATE(l,ni,M,N) DO ni = 1, g_Ndim DO l = 1, g_junct M = N - g_alpha(:,l) END DO END DO !$OMP END PARALLEL END SUBROUTINE ConstructH END PROGRAM Lanczos -- Summary: internal compiler error: Segmentation fault. gfortran openmp Product: gcc Version: 4.2.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: m dot c dot schaafsma at student dot tudelft dot nl http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37848