http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57542
Bug ID: 57542 Summary: [OOP, Fortran] ICE on FINALization with specific options Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: sfilippone at uniroma2 dot it Created attachment 30267 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30267&action=edit Test case The attached code triggers an ICE with debug options -O0 -ggdb -fcheck=all ---------------------------- log ----------------------------------- [sfilippo@jacobi BugDeallocateFinal]$ gfortran -v Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/usr/local/gnu49/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc/configure --prefix=/usr/local/gnu49 --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/gnu49 --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/gnu49 --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/gnu49 --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 Thread model: posix gcc version 4.9.0 20130605 (experimental) (GCC) [sfilippo@jacobi BugDeallocateFinal]$ gfortran -c -O3 testFinal.f90 [sfilippo@jacobi BugDeallocateFinal]$ gfortran -c -O0 -ggdb -fcheck=all testFinal.f90 testFinal.f90: In function 'testfinal': testFinal.f90:24:0: internal compiler error: in gfc_build_final_call, at fortran/trans.c:898 deallocate(var%v(1)%item%item) ^ 0x5b97d1 gfc_build_final_call ../../gcc/gcc/fortran/trans.c:898 0x5b97d1 gfc_add_finalizer_call(stmtblock_t*, gfc_expr*) ../../gcc/gcc/fortran/trans.c:1014 0x5b9aee gfc_deallocate_scalar_with_status(tree_node*, tree_node*, bool, gfc_expr*, gfc_typespec) ../../gcc/gcc/fortran/trans.c:1298 0x61c174 gfc_trans_deallocate(gfc_code*) ../../gcc/gcc/fortran/trans-stmt.c:5429 0x5b8a47 trans_code ../../gcc/gcc/fortran/trans.c:1683 0x5e0cce gfc_generate_function_code(gfc_namespace*) ../../gcc/gcc/fortran/trans-decl.c:5460 0x5788f8 translate_all_program_units ../../gcc/gcc/fortran/parse.c:4509 0x5788f8 gfc_parse_file() ../../gcc/gcc/fortran/parse.c:4706 0x5b47f5 gfc_be_parse_file ../../gcc/gcc/fortran/f95-lang.c:189 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. [sfilippo@jacobi BugDeallocateFinal]$