http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414

--- Comment #3 from janus at gcc dot gnu.org ---
(In reply to janus from comment #2)
> With the patch the reduced test case in comment 1 compiles cleanly, but the
> full code in comment 0 then gives an ICE on a different location:
> 
> ObjectLists.f90: In function ‘addarray’:
> ObjectLists.f90:240:0: internal compiler error: in gfc_conv_expr_descriptor,
> at fortran/trans-array.c:6473
>              allocate(Pt%P(1:SIZE(P)), source= P)


Here is a reduced test case for the ICE (which seems unrelated to the original
error):


module ObjectLists
  implicit none

  type :: t
  end type

  type Object_array_pointer
    class(t), pointer :: p(:)
  end type

contains

  subroutine AddArray (P, Pt)
    class(t) :: P(:)
    class(Object_array_pointer) :: Pt

    select type (Pt)
    class is (Object_array_pointer)
      allocate(Pt%P(1:SIZE(P)), source=P)
    end select
  end subroutine

end module

Reply via email to