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, 23 Jun 2016 18:37:07 +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
Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |gerhard.steinmetz.fortran@t
| |-online.de
--- Comment #7 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
Compiles if "size" is replaced with synonym "product(shape)".
$ cat z5.f90
module m
type t
end type
contains
function foo(a, b) result(add)
class(t), intent(in) :: a(:)
class(t), intent(in) :: b(product(shape(a)))
type(t) :: add(product(shape(a)))
end function
end module
program p
use m
end program
$ gfortran-6 -g -O0 -fcheck=all z5.f90
$ cat z6.f90
module m
type t
end type
contains
function foo(a, b) result(add)
class(*), intent(in) :: a(:)
class(*), intent(in) :: b(product(shape(a)))
type(t) :: add(product(shape(a)))
end function
end module
program p
use m
end program
$ gfortran-6 -g -O0 -fcheck=all z6.f90
Remark:
This workaround may or may not work for production codes, it depends.