The code and error message below demonstrate an ICE that occurs when passing an actual argument that extends a type with two components: a default-initialized scalar and an allocatable scalar coarray. Damian $ cat all.f90 program main implicit none type co_object logical :: defined=.false. real, allocatable :: dummy_to_facilitate_extension[:] end type type, extends(co_object) :: global_field end type type(global_field) T call assign_local_field(T) contains subroutine assign_local_field(lhs) type(global_field) lhs end subroutine end program $ gfortran -fcoarray=single all.f90 all.f90: In function 'MAIN__': all.f90:9:0: internal compiler error: in fold_convert_loc, at fold-const.c:2116 type(global_field) T ^ all.f90:9:0: internal compiler error: Abort trap: 6 gfortran: internal compiler error: Abort trap: 6 (program f951) Abort trap: 6 $ gfortran --version GNU Fortran (MacPorts gcc49 4.9-20140406_0) 4.9.0 20140406 (experimental) Copyright (C) 2014 Free Software Foundation, Inc.
Confirmed on 4.7.4, 4.8.3, 4.9.0, and trunk.
Author: burnus Date: Tue Apr 22 19:28:43 2014 New Revision: 209657 URL: http://gcc.gnu.org/viewcvs?rev=209657&root=gcc&view=rev Log: 2014-04-22 Tobias Burnus <burnus@net-b.de> PR fortran/60881 * trans-expr.c (gfc_trans_subcomponent_assign): Fix handling of scalar coarrays. 2014-04-22 Tobias Burnus <burnus@net-b.de> PR fortran/60881 * coarray/alloc_comp_3.f90: New. Added: trunk/gcc/testsuite/gfortran.dg/coarray/alloc_comp_3.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-expr.c trunk/gcc/testsuite/ChangeLog
FIXED on the trunk (GCC 4.10). Thanks for the report!