https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65548
Bug ID: 65548 Summary: [5.0 Regression] gfc_conv_procedure_call Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: juergen.reuter at desy dot de The following code {{{ module selectors type :: selector_t integer, dimension(:), allocatable :: map real, dimension(:), allocatable :: weight contains procedure :: init => selector_init end type selector_t contains subroutine selector_init (selector, weight) class(selector_t), intent(out) :: selector real, dimension(:), intent(in) :: weight real :: s integer :: n, i logical, dimension(:), allocatable :: mask s = sum (weight) allocate (mask (size (weight)), source = weight /= 0) n = count (mask) if (n > 0) then allocate (selector%map (n), & source = pack ([(i, i = 1, size (weight))], mask)) allocate (selector%weight (n), & source = pack (weight / s, mask)) else allocate (selector%map (1), source = 1) allocate (selector%weight (1), source = 0.) end if end subroutine selector_init end module selectors }}} yields an ICE with gfortran 5.0 trunk: $ gfortran -c selectors.f90 selectors.f90:23:0: source = pack ([(i, i = 1, size (weight))], mask)) 1 internal compiler error: in gfc_conv_procedure_call, at fortran/trans-expr.c:5608 selectors.f90:23:0: internal compiler error: Abort trap: 6 gfortran: internal compiler error: Abort trap: 6 (program f951) My gcc version is r221644 from the trunk, a version from ca. March 4th or 5th did still work.