Summary: | Array copy operation produces garbage | ||
---|---|---|---|
Product: | gcc | Reporter: | Erik Schnetter <schnetter> |
Component: | fortran | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | gcc-bugs, gruel, tobi |
Priority: | P2 | Keywords: | wrong-code |
Version: | 4.0.0 | ||
Target Milestone: | 4.0.0 | ||
Host: | i686-pc-linux-gnu | Target: | i686-pc-linux-gnu |
Build: | i686-pc-linux-gnu | Known to work: | |
Known to fail: | Last reconfirmed: | 2005-01-06 16:28:46 | |
Attachments: | failing source code |
Description
Erik Schnetter
2004-05-20 13:25:05 UTC
Created attachment 6347 [details]
failing source code
Confirmed. Fixed, how long a long I do not know. 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 Reopened. Might be target specific. *** Bug 18022 has been marked as a duplicate of this bug. *** The reduced testcase does not fail with 20050102 snapshot on ia64-unknown-linux-gnu: $ gfortran arrpack.f90 $ ./a.out pack copy -1 -2 -2 -2 copy 0 -1 -1 -1 $ ifort arrpack.f90 $ ./a.out pack copy -1 -2 -2 -2 copy 0 -1 -1 -1 Still fails on i686-pc-linux: [tobi@marktplatz tests]$ ./a.out pack copy -1 -2 -2 -2 copy 9049312 -1 -1 -1 [tobi@marktplatz tests]$ gfortran --version GNU Fortran 95 (GCC 4.0.0 20050104 (experimental)) Copyright (C) 2004 Free Software Foundation, Inc. (In reply to comment #8) > Still fails on i686-pc-linux: Is this something that should be put into the test suite, so it is possible to get a better overview of when and on which machines this fails? Subject: Re: Array copy operation produces garbage
Thomas dot Koenig at online dot de wrote:
> ------- Additional Comments From Thomas dot Koenig at online dot de 2005-01-07 10:37 -------
> (In reply to comment #8)
>
>>Still fails on i686-pc-linux:
>
>
> Is this something that should be put into the test suite,
> so it is possible to get a better overview of when and
> on which machines this fails?
gcc's policy is no known failures in the testsuite, so I'm afraid this is not
possible. I do think this is a good idea, but only to the extent that other
people's development work is not interfered with by spurious testsuite FAILs /
XPASSes, which is inevitable in this case.
I took time to look at this again, and I'm sorry to say that my reduced testcase did print out an uninitialized variable, and was therefore wrong. My apologies to all those who have wasted their time on this. Since I don't know when or how this was fixed, I'll close this as WORKSFORME. I'll see about creating something for the testsuite. Subject: Bug 15553 CVSROOT: /cvs/gcc Module name: gcc Changes by: tobi@gcc.gnu.org 2005-01-07 11:56:12 Modified files: gcc/testsuite : ChangeLog Added files: gcc/testsuite/gfortran.dg: array-1.f90 Log message: PR fortran/15553 * gfortran.dg/array-1.f90: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4863&r2=1.4864 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/array-1.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1 |