This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/57284] [OOP] ICE with find_array_spec for polymorphic arrays


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57284

--- Comment #4 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
As known, causative is the class declaration of "a", when using size(a).
Some variants, replacing "class" with "type" :


$ cat z2.f90
module m
  type t
  end type
contains
  function foo(a, b) result(add)
    class(t), intent(in) :: a(:)
    type(t), intent(in) :: b(size(a))
    type(t) :: add(size(a))
  end function
end module

program p
  use m
end program


$ gfortran-6 -c z2.f90
f951: internal compiler error: find_array_spec(): unused as(1)

---

$ cat z3.f90
module m
  type t
  end type
contains
  function foo(a, b) result(add)
    type(t), intent(in) :: a(:)
    class(t), intent(in) :: b(size(a))
    type(t) :: add(size(a))
  end function
end module

program p
  use m
end program


$ gfortran-6 -c z3.f90
# ok

---

$ cat z4.f90
module m
  type t
  end type
contains
  function foo(a, b) result(add)
    type(t), intent(in) :: a(:)
    type(t), intent(in) :: b(size(a))
    type(t) :: add(size(a))
  end function
end module

program p
  use m
end program


$ gfortran-6 -c z4.f90
# ok

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]