https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105182
Bug ID: 105182 Summary: compiling NJOY21 causes a ICE segmentation fault: 11 Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: kermitnuc at gmail dot com Target Milestone: --- GCC 10.3 compiles NJOY21 without issue. GCC 11.1 and 11.2 do not. GCC configure script: /configure --prefix=/usr/local/gcc-1030 --enable-languages=c,c++,fortran,lto CC=/usr/bin/gcc CXX=/usr/bin/g++ LD=/usr/bin/ld --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --with-isl=/usr/local --with-libiconv-prefix=/usr/local --with-libiconv=/usr/local --with-system-zlib --with-native-system-header-dir=/usr/include --build=x86_64-apple-darwin21.4.0 CXXFLAGS="-I/usr/local/include " CCFLAGS="-I/usr/local/include " LDFLAGS="-L/usr/local/lib " CPPFLAGS="-I/usr/local/include " --enable-libatomic --enable-libgomp --enable-libitm --enable-libquadmath --enable-libquadmath-support -enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk Similar for 11.1 and 11.2. Using XCODE 13 on MacOS 12.3.1 NJOY21 is available at: https://www.njoy21.io The error when compiling the ERRORR.F90 subroutine. NJOY configure script: cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_VERBOSE_MAKEFILE:BOOL=TRUE -D CMAKE_CXX_COMPILER=/usr/local/gcc-1120/bin/x86_64-apple-darwin21.4.0-c++ -D CMAKE_Fortran_COMPILER=/usr/local/gcc-1120/bin/x86_64-apple-darwin21.4.0-gfortran -D CMAKE_Fortran_FLAGS_RELEASE='-fno-stack-limit -frecursive -fcheck=all -pedantic -Wdo-subscript -std=legacy -v -fdump-tree-original -Wdo-subscript ' ../ Compiler output: [ 27%] Building Fortran object _deps/njoy-build/CMakeFiles/njoy.dir/src/samm.f90.o /Users/kermitnuc/NJOY21/bin/_deps/njoy-src/src/samm.f90:4518:38: 4515 | do n=1,100 | 2 ...... 4518 | a(n)=-(delta*(xn-1)*(xn-2)*a(n-1)+& | 1 Warning: Array reference at (1) out of bounds (0 < 1) in loop beginning at (2) [-Wdo-subscript] /Users/kermitnuc/NJOY21/bin/_deps/njoy-src/src/samm.f90:4519:37: 4515 | do n=1,100 | 2 ...... 4519 | (rhoi-2*eta)*(delta**2)*a(n-2)+(delta**3)*a(n-3))/& | 1 Warning: Array reference at (1) out of bounds (-1 < 1) in loop beginning at (2) [-Wdo-subscript] /Users/kermitnuc/NJOY21/bin/_deps/njoy-src/src/samm.f90:4519:55: 4515 | do n=1,100 | 2 ...... 4519 | (rhoi-2*eta)*(delta**2)*a(n-2)+(delta**3)*a(n-3))/& | 1 Warning: Array reference at (1) out of bounds (-2 < 1) in loop beginning at (2) [-Wdo-subscript] [ 28%] Building Fortran object _deps/njoy-build/CMakeFiles/njoy.dir/src/errorr.f90.o f951: internal compiler error: Segmentation fault: 11 Please submit a full bug report, with preprocessed source if appropriate. See <https://gcc.gnu.org/bugs/> for instructions. make[2]: *** [_deps/njoy-build/CMakeFiles/njoy.dir/build.make:239: _deps/njoy-build/CMakeFiles/njoy.dir/src/errorr.f90.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:2603: _deps/njoy-build/CMakeFiles/njoy.dir/all] Error 2 make: *** [Makefile:161: all] Error 2