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/31009] Use memcpy when assigning whole arrays



------- Comment #3 from tkoenig at gcc dot gnu dot org  2007-03-01 19:41 -------
(In reply to comment #2)

> Since the finer details of fortran still elude me, is it possible at all that
> in a statement as "this = other" were both shall be arrays of compatible shape,
> either stride may not equal '1'?

Yes.

The following is legal:

program main
  real, dimension(4) :: a
  a = (/ 1., 2., 3., 4. /)
  call foo(a(1:3:2), a(2:4:2))
  print *,a
contains
  subroutine foo(x,y)
    real, dimension(:), intent(in) :: x
    real, dimension(:), intent(out) :: y
    y = x
  end subroutine foo
end program main


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31009


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