https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91332

            Bug ID: 91332
           Summary: ICE: Segfault in gfortran when compiling massive
                    function with -O3
           Product: gcc
           Version: 7.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: clogged.drainpipe at gmail dot com
  Target Milestone: ---

Created attachment 46664
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46664&action=edit
gzipped source to reproduce

Hello!

We have run into an ICE when we tried to compile an admittedly pretty massive
subroutine. I am not sure which component is segfaulting, so for lack of better
idea I am filing this under gfortran, please feel free to reassign it as you
see fit. The system is running Ubuntu 18.04 LTS. Gfortran just throws an ICE
segfault after about an hour of wall time. Please note that gfortran also
consumes ~60+ GiB of RAM before finally segfaulting. I tested on a machine that
has 64 GiB of RAM and some swap on an SSD, and apart from the segfault I had no
issues, but with less RAM this might be challenging to reproduce.

The command line that causes the crash is:
gfortran -v -O3 -march=skylake -ffree-line-length-0 -save-temps -c dmono_4.f90

Interestingly, there is no crash with O0,O1 or even O2. I am yet to test other
optimization levels. Not much else can I say about this, but if anyone needs
more info, please do ask.

Complete output of the command line above:

Using built-in specs.
COLLECT_GCC=gfortran
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
7.4.0-1ubuntu1~18.04.1' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr
--with-gcc-major-version-only --program-suffix=-7
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie
--with-system-zlib --with-target-system-zlib --enable-objc-gc=auto
--enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
COLLECT_GCC_OPTIONS='-v' '-O3' '-march=skylake' '-ffree-line-length-0'
'-save-temps' '-c'
 /usr/lib/gcc/x86_64-linux-gnu/7/f951 dmono_4.f90 -quiet -dumpbase dmono_4.f90
-march=skylake -auxbase dmono_4 -O3 -version -ffree-line-length-0
-fintrinsic-modules-path /usr/lib/gcc/x86_64-linux-gnu/7/finclude -o dmono_4.s
GNU Fortran (Ubuntu 7.4.0-1ubuntu1~18.04.1) version 7.4.0 (x86_64-linux-gnu)
        compiled by GNU C version 7.4.0, GMP version 6.1.2, MPFR version 4.0.1,
MPC version 1.1.0, isl version isl-0.19-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran2008 (Ubuntu 7.4.0-1ubuntu1~18.04.1) version 7.4.0
(x86_64-linux-gnu)
        compiled by GNU C version 7.4.0, GMP version 6.1.2, MPFR version 4.0.1,
MPC version 1.1.0, isl version isl-0.19-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
dmono_4.f90:19736:0:

   end subroutine devmono_4

internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.

Reply via email to