https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63494
Bug ID: 63494 Summary: internal compiler error: Bus error, and out of memory allocating ... Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: jwmwalrus at gmail dot com With the code below I get two errors while compiling. One with the preprocessor, and one without. module my_lrstring implicit none private save type :: lrStringType character(:), allocatable :: left character(:), allocatable :: right end type type, public :: lrString type(lrStringType), allocatable, private :: storage(:) contains procedure :: getRight end type contains pure function getRight(this, left) result(right) character(:), allocatable :: right class(lrString), intent(IN) :: this character(*), intent(IN) :: left integer :: i, j character(:), allocatable :: text right = '' j = INDEX(this%storage(i)%right, '{}') text = this%storage(i)%right(j+2:) end function end module my_lrstring The output I get is: $ gfortran-5.0 -c -g -x f95-cpp-input -Dmy_lrstring=my_lrstring_dbg my_lrstring.f90 f951: internal compiler error: Bus error Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-snapshot/README.Bugs> for instructions. $ gfortran -c -g my_lrstring.f90 f951: out of memory allocating 20501133024 bytes after a total of 692224 bytes The compiler and system information is: $ lsb_release -rd Description: Debian GNU/Linux testing (jessie) Release: testing $ gfortran-5.0 -v Using built-in specs. COLLECT_GCC=gfortran-5.0 COLLECT_LTO_WRAPPER=/usr/lib/gcc-snapshot/libexec/gcc/x86_64-linux-gnu/5.0.0/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 20140903-1' --with-bugurl=file:///usr/share/doc/gcc-snapshot/README.Bugs --enable-languages=c,ada,c++,java,go,fortran,objc,obj-c++ --prefix=/usr/lib/gcc-snapshot --enable-shared --enable-linker-build-id --disable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5.0-snap-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5.0-snap-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5.0-snap-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --with-arch-32=i586 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --disable-werror --enable-checking=yes --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 5.0.0 20140904 (experimental) [trunk revision 214924] (Debian 20140903-1) $ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 31147 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 65536 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 31147 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited