This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31009] Use memcpy when assigning whole arrays
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Mar 2007 19:41:51 -0000
- Subject: [Bug fortran/31009] Use memcpy when assigning whole arrays
- References: <bug-31009-13648@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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