https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61819
Bug ID: 61819
Summary: ICE in gfc_conv_descriptor_data_get
Product: gcc
Version: 4.10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: sfilippone at uniroma2 dot it
The attached code produces the ICE in both trunk and 4.9.0.
The code is from a test case I was trying to reduce while investigating a
memory leak, so something fishy is going on.
------------------ trunk -----------
[sfilippo@jacobi leak-demo]$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gnu/4.10/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure --prefix=/usr/local/gnu/4.10
--enable-languages=c,c++,fortran --with-gmp=/home/travel/GNUBUILD/gmp
--with-mpfr=/home/travel/GNUBUILD/mpfr --with-mpc=/home/travel/GNUBUILD/mpc
--with-cloog=/home/travel/GNUBUILD/cloog : (reconfigured) ../gcc/configure
--prefix=/usr/local/gnu/4.10 --with-gmp=/home/travel/GNUBUILD/gmp
--with-mpfr=/home/travel/GNUBUILD/mpfr --with-mpc=/home/travel/GNUBUILD/mpc
--with-cloog=/home/travel/GNUBUILD/cloog --enable-languages=c,c++,fortran,lto
--no-create --no-recursion
Thread model: posix
gcc version 4.10.0 20140708 (experimental) (GCC)
[sfilippo@jacobi leak-demo]$ gfortran -O0 -ggdb -o foo-test foo-test.f90
foo-test.f90: In function ‘__final_foo_vector_field_mod_Vector_field’:
foo-test.f90:196:0: internal compiler error: in gfc_conv_descriptor_data_get,
at fortran/trans-array.c:146
end module foo_vector_field_mod
^
0x602855 gfc_conv_descriptor_data_get(tree_node*)
../../gcc/gcc/fortran/trans-array.c:146
0x609a5e gfc_array_deallocate(tree_node*, tree_node*, tree_node*, tree_node*,
tree_node*, gfc_expr*)
../../gcc/gcc/fortran/trans-array.c:5346
0x672bda gfc_trans_deallocate(gfc_code*)
../../gcc/gcc/fortran/trans-stmt.c:5484
0x5feb47 trans_code
../../gcc/gcc/fortran/trans.c:1798
0x668553 gfc_trans_if_1
../../gcc/gcc/fortran/trans-stmt.c:989
0x66edda gfc_trans_if(gfc_code*)
../../gcc/gcc/fortran/trans-stmt.c:1020
0x5fec37 trans_code
../../gcc/gcc/fortran/trans.c:1736
0x670104 gfc_trans_simple_do
../../gcc/gcc/fortran/trans-stmt.c:1446
0x670104 gfc_trans_do(gfc_code*, tree_node*)
../../gcc/gcc/fortran/trans-stmt.c:1609
0x5fec0a trans_code
../../gcc/gcc/fortran/trans.c:1748
0x628cdb gfc_generate_function_code(gfc_namespace*)
../../gcc/gcc/fortran/trans-decl.c:5734
0x6005f1 gfc_generate_module_code(gfc_namespace*)
../../gcc/gcc/fortran/trans.c:1995
0x5bb861 translate_all_program_units
../../gcc/gcc/fortran/parse.c:4934
0x5bb861 gfc_parse_file()
../../gcc/gcc/fortran/parse.c:5144
0x5fa195 gfc_be_parse_file
../../gcc/gcc/fortran/f95-lang.c:212
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
------------------- 4.9-------------------
[sfilippo@jacobi leak-demo]$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gnu/4.9.0/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.9.0/configure --prefix=/usr/local/gnu/4.9.0
--enable-languages=c,c++,fortran --with-gmp=/home/travel/GNUBUILD/gmp
--with-mpfr=/home/travel/GNUBUILD/mpfr --with-mpc=/home/travel/GNUBUILD/mpc
Thread model: posix
gcc version 4.9.0 (GCC)
[sfilippo@jacobi leak-demo]$ gfortran -O0 -ggdb -o foo-test foo-test.f90
foo-test.f90: In function ‘__final_foo_vector_field_mod_Vector_field’:
foo-test.f90:196:0: internal compiler error: in gfc_conv_descriptor_data_get,
at fortran/trans-array.c:145
end module foo_vector_field_mod
^
0x5e2348 gfc_conv_descriptor_data_get(tree_node*)
../../gcc-4.9.0/gcc/fortran/trans-array.c:145
0x5e7e3f gfc_array_deallocate(tree_node*, tree_node*, tree_node*, tree_node*,
tree_node*, gfc_expr*)
../../gcc-4.9.0/gcc/fortran/trans-array.c:5346
0x62f7ca gfc_trans_deallocate(gfc_code*)
../../gcc-4.9.0/gcc/fortran/trans-stmt.c:5478
0x5df257 trans_code
../../gcc-4.9.0/gcc/fortran/trans.c:1798
0x626623 gfc_trans_if_1
../../gcc-4.9.0/gcc/fortran/trans-stmt.c:986
0x62c3aa gfc_trans_if(gfc_code*)
../../gcc-4.9.0/gcc/fortran/trans-stmt.c:1017
0x5df347 trans_code
../../gcc-4.9.0/gcc/fortran/trans.c:1736
0x62d4a1 gfc_trans_simple_do
../../gcc-4.9.0/gcc/fortran/trans-stmt.c:1440
0x62d4a1 gfc_trans_do(gfc_code*, tree_node*)
../../gcc-4.9.0/gcc/fortran/trans-stmt.c:1603
0x5df31a trans_code
../../gcc-4.9.0/gcc/fortran/trans.c:1748
0x5fe6bb gfc_generate_function_code(gfc_namespace*)
../../gcc-4.9.0/gcc/fortran/trans-decl.c:5610
0x5e06e1 gfc_generate_module_code(gfc_namespace*)
../../gcc-4.9.0/gcc/fortran/trans.c:1972
0x59e809 translate_all_program_units
../../gcc-4.9.0/gcc/fortran/parse.c:4522
0x59e809 gfc_parse_file()
../../gcc-4.9.0/gcc/fortran/parse.c:4732
0x5db545 gfc_be_parse_file
../../gcc-4.9.0/gcc/fortran/f95-lang.c:188
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.