http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57556
Bug ID: 57556 Summary: [OOP][Regression] ICE with move_alloc on polymorphic component 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 30274 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30274&action=edit Test case The attached code generates the ICE when compiled with -fcheck=all. Looks very similar but independent of PR57542, since the patch for the latter was already applied. Works with 4.7/4.8. ------------------------------------------------ [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 20130606 (experimental) (GCC) [sfilippo@jacobi BugDeallocateFinal]$ gfortran -c testMoveAlloc.f90 [sfilippo@jacobi BugDeallocateFinal]$ gfortran -c -fcheck=all testMoveAlloc.f90 testMoveAlloc.f90: In function 'realloc_pool': testMoveAlloc.f90:31:0: internal compiler error: tree check: did not expect class 'type', have 'type' (boolean_type) in append_to_statement_list, at tree-iterator.c:94 call move_alloc(pool(i)%item,dbp(i)%item) ^ 0xb57be9 tree_not_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ../../gcc/gcc/tree.c:9159 0x9d9a0c non_type_check ../../gcc/gcc/tree.h:3869 0x9d9a0c append_to_statement_list(tree_node*, tree_node**) ../../gcc/gcc/tree-iterator.c:94 0x5b6f32 add_expr_to_chain ../../gcc/gcc/fortran/trans.c:1402 0x5b8ec6 gfc_add_block_to_block(stmtblock_t*, stmtblock_t*) ../../gcc/gcc/fortran/trans.c:1448 0x5b909b gfc_build_final_call ../../gcc/gcc/fortran/trans.c:898 0x5b909b gfc_add_finalizer_call(stmtblock_t*, gfc_expr*) ../../gcc/gcc/fortran/trans.c:1016 0x5b9aee gfc_deallocate_scalar_with_status(tree_node*, tree_node*, bool, gfc_expr*, gfc_typespec) ../../gcc/gcc/fortran/trans.c:1300 0x6038ec conv_intrinsic_move_alloc ../../gcc/gcc/fortran/trans-intrinsic.c:7592 0x6038ec gfc_conv_intrinsic_subroutine(gfc_code*) ../../gcc/gcc/fortran/trans-intrinsic.c:7790 0x5b8bd2 trans_code ../../gcc/gcc/fortran/trans.c:1594 0x619544 gfc_trans_simple_do ../../gcc/gcc/fortran/trans-stmt.c:1425 0x619544 gfc_trans_do(gfc_code*, tree_node*) ../../gcc/gcc/fortran/trans-stmt.c:1588 0x5b8b0a trans_code ../../gcc/gcc/fortran/trans.c:1635 0x5e0cce gfc_generate_function_code(gfc_namespace*) ../../gcc/gcc/fortran/trans-decl.c:5460 0x5b9fd1 gfc_generate_module_code(gfc_namespace*) ../../gcc/gcc/fortran/trans.c:1859 0x578677 ../../gcc/gcc/fortran/parse.c:4496 0x578677 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]$ translate_all_program_units