Using the following compiler release: GNU Fortran (GCC) 4.9.0 20140309 (experimental) on the following reproducer: --- module T_mod implicit none type :: TS integer, allocatable :: i(:) end type TS type :: T ! The following line causes an internal compiler error. type (TS) :: s(1) ! The following line does not: ! type (TS), allocatable :: s(:) end type T contains subroutine insert(this) class(T) :: this end subroutine insert end module T_mod --- yields an internal compiler error: repro.F90: In function ‘__final_t_mod_T’: repro.F90:19:0: internal compiler error: in gfc_conv_descriptor_data_get, at fortran/trans-array.c:145 end module T_mod ^ 0x511048 ??? ../sysdeps/x86_64/elf/start.S:113 I am running on a Linux cluster: Linux discover28 2.6.32.54-0.3-default #1 SMP 2012-01-27 17:38:56 +0100 x86_64 x86_64 x86_64 GNU/Linux Note that the internal compiler error does not occur with two earlier releases of gfortran: GNU Fortran (GCC) 4.9.0 20140105 (experimental) GNU Fortran (GCC) 4.8.1
Confirmed. Slightly reduced test case: implicit none type :: TS integer, allocatable :: i end type type :: T type (TS) :: s(1) end type class(T), allocatable :: X end Does not show an error with 4.6, 4.7 and 4.8. Backtrace with 4.9: 0x61ea98 gfc_conv_descriptor_data_get(tree_node*) /home/jweil/gcc49/trunk/gcc/fortran/trans-array.c:145 0x6245a0 gfc_array_deallocate(tree_node*, tree_node*, tree_node*, tree_node*, tree_node*, gfc_expr*) /home/jweil/gcc49/trunk/gcc/fortran/trans-array.c:5340 0x66bf8d gfc_trans_deallocate(gfc_code*) /home/jweil/gcc49/trunk/gcc/fortran/trans-stmt.c:5476 0x61b5a7 trans_code /home/jweil/gcc49/trunk/gcc/fortran/trans.c:1782 0x669bd1 gfc_trans_simple_do /home/jweil/gcc49/trunk/gcc/fortran/trans-stmt.c:1438 0x669bd1 gfc_trans_do(gfc_code*, tree_node*) /home/jweil/gcc49/trunk/gcc/fortran/trans-stmt.c:1601 0x61b66a trans_code /home/jweil/gcc49/trunk/gcc/fortran/trans.c:1732 0x63b132 gfc_generate_function_code(gfc_namespace*) /home/jweil/gcc49/trunk/gcc/fortran/trans-decl.c:5610 0x63afe7 gfc_generate_contained_functions /home/jweil/gcc49/trunk/gcc/fortran/trans-decl.c:4728 0x63afe7 gfc_generate_function_code(gfc_namespace*) /home/jweil/gcc49/trunk/gcc/fortran/trans-decl.c:5546 Probably caused by the finalization implementation?
r206362 (2014-01-06) is OK, r206567 (2014-01-12) gives the ICE. > Probably caused by the finalization implementation? Author: janus Date: Mon Jan 6 23:21:39 2014 New Revision: 206379 URL: http://gcc.gnu.org/viewcvs?rev=206379&root=gcc&view=rev Log: 2014-01-06 Janus Weil <janus@gcc.gnu.org> PR fortran/59589 * class.c (comp_is_finalizable): New function to dermine if a given component is finalizable. (finalize_component, generate_finalization_wrapper): Use it. 2014-01-06 Janus Weil <janus@gcc.gnu.org> PR fortran/59589 * gfortran.dg/class_allocate_16.f90: New. Added: trunk/gcc/testsuite/gfortran.dg/class_allocate_16.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/class.c trunk/gcc/testsuite/ChangeLog is in the range.
GCC 4.9.0 has been released
GCC 4.9.1 has been released.
Per pr61819, duplicate of pr 59765. *** This bug has been marked as a duplicate of bug 59765 ***
This is the same as PR64932 and PR59765. I have posted a patch for the former. Thanks for pointing this out Dominique! Paul