The attached file gives: gfortran -c -O2 element_defs.f90 element_defs.f90: In function ‘create_coefficients’: element_defs.f90:20:0: internal compiler error: in gfc_conv_descriptor_data_get, at fortran/trans-array.c:144 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.
Created attachment 22676 [details] source file of module
Confirmed on trunk and 4.5.0. If I replace procedure (dum_vfunc), pointer, nopass :: p => null() with procedure (dum_vfunc), pointer, nopass :: p the ICE goes away.
Confirmed. Slightly reduced test case: type vfunc_p procedure (dum_vfunc), pointer, nopass :: p => null() end type vfunc_p type(vfunc_p), allocatable, dimension(:) :: vfunc1 allocate(vfunc1(10)) contains function dum_vfunc () real, dimension(2) :: dum_vfunc dum_vfunc = 0 end function dum_vfunc end
Here's the fix: Index: gcc/fortran/trans-expr.c =================================================================== --- gcc/fortran/trans-expr.c (revision 167730) +++ gcc/fortran/trans-expr.c (working copy) @@ -4452,7 +4452,7 @@ gfc_class_null_initializer (&cm->ts)); gfc_add_expr_to_block (&block, tmp); } - else if (cm->attr.dimension) + else if (cm->attr.dimension && !cm->attr.proc_pointer) { if (cm->attr.allocatable && expr->expr_type == EXPR_NULL) gfc_conv_descriptor_data_set (&block, dest, null_pointer_node); Will commit as obvious after regtesting.
Author: janus Date: Mon Dec 13 16:16:06 2010 New Revision: 167750 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167750 Log: 2010-12-13 Janus Weil <janus@gcc.gnu.org> PR fortran/46841 * trans-expr.c (gfc_trans_subcomponent_assign): Handle array-valued procedure pointer components. 2010-12-13 Janus Weil <janus@gcc.gnu.org> PR fortran/46841 * gfortran.dg/proc_ptr_comp_26.f90: New. Added: trunk/gcc/testsuite/gfortran.dg/proc_ptr_comp_26.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-expr.c trunk/gcc/testsuite/ChangeLog
Fixed with r167750. Closing.