http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52386
Bug #: 52386
Summary: ICE in gfc_conv_descriptor_dtyp
Classification: Unclassified
Product: gcc
Version: 4.6.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: [email protected]
ReportedBy: [email protected]
Created attachment 26755
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26755
Code triggering the ICE.
This is a regression in gfortran 4.6.x of a bug not being present in the gcc
4.5.x versions of the compiler. When compiling the 13 line of codes below I
get:
gfortran -c cascades.f90
cascades.f90: In function ‘reduced’:
cascades.f90:11:0: internal compiler error: in gfc_conv_descriptor_dtype, at
fortran/trans-array.c:239
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
The error arises in the pack function. I did not test whether this is still be
present in gfortran 4.7.0. Here is the code:
module cascades
implicit none
private
contains
function reduced (array)
integer, dimension(:), allocatable :: reduced
integer, dimension(:), intent(in) :: array
logical, dimension(size(array)) :: mask
mask = .true.
allocate (reduced (count (mask)))
reduced = pack (array, mask)
end function reduced
end module cascades
I also add the code as attachment.