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

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.

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