This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/57284] [OOP] ICE with find_array_spec for polymorphic arrays
- From: "gerhard dot steinmetz dot fortran at t-online dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 04 Feb 2016 18:16:38 +0000
- Subject: [Bug fortran/57284] [OOP] ICE with find_array_spec for polymorphic arrays
- Auto-submitted: auto-generated
- References: <bug-57284-4 at http dot gcc dot gnu dot org/bugzilla/>
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