This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/15553] Array copy operation produces garbage
- From: "tobi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Sep 2004 13:45:32 -0000
- Subject: [Bug fortran/15553] Array copy operation produces garbage
- References: <20040520132504.15553.schnetter@aei.mpg.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From tobi at gcc dot gnu dot org 2004-09-21 13:45 -------
Are you sure, Andrew. My reduced testcase still fails for me on i686-pc-linux:
program arrpack
implicit none
integer x(1,1), y(1,1)
integer i, j
x = -1
call pack (x, 1, 1)
x = -1
call copy (y, x, 1, 1)
contains
subroutine pack (arr, ni, nj)
integer, intent(in) :: ni, nj
integer, intent(inout) :: arr(:,:)
integer :: tmp(ni,nj)
tmp(:,:) = arr(1:ni, 1:nj)
print *, "pack"
tmp(1,1) = -2
call copy (arr, tmp, ni,nj) !tmp, ni, nj)
end subroutine pack
subroutine copy (dst, src, ni, nj)
integer, intent(in) :: ni, nj
integer :: dst(ni, nj)
integer :: src(ni, nj)
print *, "copy"
print *, dst, src
dst = src
print *, dst, src
end subroutine copy
end program arrpack
prints:
[tobi@marktplatz tests]$ ./a.out
pack
copy
-1 -2
-2 -2
copy
9612368 -1
-1 -1
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |tobi at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15553