[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#819367: gfortran: ICE with -fcheck=mem when initializing an array in a derived type



Package: gfortran
Version: 4:5.3.1-1
Severity: important
Tags: upstream

Dear Maintainer,

I am receiving an internal compiler error (ICE) with gfortran when I
try to compile code that initializes an array (pointer or allocatable)
defined inside a datatype with a scalar value. The problem only
happens with the -check=mem flag.

This is a test code that triggers the error:

--

program test

  type tt
    real(8), allocatable :: aa(:)
  end type tt

  type(tt) :: cc

  allocate(cc%aa(1:10))

  cc%aa = 0.0_8

end program test

--

This is the compilation line:

gfortran -fcheck=mem array.f90

and the error message:

--
array.f90:11:0:

   cc%aa = 0.0_8
 1
internal compiler error: in wide_int_to_tree, at tree.c:1464
0x969524 wide_int_to_tree(tree_node*,
generic_wide_int<wide_int_ref_storage<false> > const&)
        ../../src/gcc/tree.c:1464
0x10ab123 build_int_cst(tree_node*, long)
        ../../src/gcc/tree.c:1272
0x64e6c3 gfc_trans_assignment_1
        ../../src/gcc/fortran/trans-expr.c:9127
0xd4cd60 trans_code
        ../../src/gcc/fortran/trans.c:1711
0xd4cd60 gfc_trans_code(gfc_code*)
        ../../src/gcc/fortran/trans.c:2020
0xd51782 gfc_generate_function_code(gfc_namespace*)
        ../../src/gcc/fortran/trans-decl.c:5927
0xd2f2a5 translate_all_program_units
        ../../src/gcc/fortran/parse.c:5406
0xd2f2a5 gfc_parse_file()
        ../../src/gcc/fortran/parse.c:5603
0x11fcaa5 gfc_be_parse_file
        ../../src/gcc/fortran/f95-lang.c:229
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
--

This is the output of gfortran -v

Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 5.3.1-12'
--with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-
languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-
suffix=-5 --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 --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-amd64/jre --enable-java-home --with-jvm-
root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-
exports/java-1.5.0-gcj-5-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 --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.3.1 20160316 (Debian 5.3.1-12)

Please let me know if there is any other information you might need.

Thank you,

Xavier





-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.2.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages gfortran depends on:
ii  cpp         4:5.3.1-1
ii  gcc         4:5.3.1-1
ii  gfortran-5  5.3.1-12

gfortran recommends no packages.

Versions of packages gfortran suggests:
ii  gfortran-doc       5:4.9.2-1
pn  gfortran-multilib  <none>

-- no debconf information
program test

  type tt
    real(8), allocatable :: aa(:)
  end type tt

  type(tt) :: cc

  allocate(cc%aa(1:10))

  cc%aa = 0.0_8

end program test

Reply to: