This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Problems with SPREAD and/or scalarization.


Hi Steve,

> program bug
>  implicit none
>  integer, parameter :: nx=4,ny=4
>  real, dimension(nx,ny) :: f, g
>  real, dimension(nx) :: x
>  integer :: i
>  x = cshift((/ (i, i = 1, nx) /), nx/2) * 2
>  g = spread(x, 2, ny)
>  !
>  ! x and g above (which compiles) are equivalent to f below (which doesn't).
>  !
>  f = spread(cshift((/ (i, i = 1, nx) /), nx/2) * 2, 2, ny)
> end program bug
> 
> kargl[236] gfc41 -o z -static f.f90
>  In file f.f90:9
> 
>  f = spread(cshift((/ (i, i = 1, nx) /), nx/2) * 2, 2, ny)
>  1
> Error: Incompatible ranks 2 and 1 in assignment at (1)


No, I didn't see this before.  Will you open a PR?

	Thomas


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