Another corner case of eoshift that's not correct...
in eoshift3, this time.

$ cat eoshift.f90
program main
  implicit none
  integer, dimension (3,3) :: a, b, w
  integer, dimension (3) :: bo, sh
  integer :: i,j

  a = reshape((/(i,i=1,9)/),shape(a))
  sh = (/ 3, -1, -3 /)
  bo = (/-999, -99, -9 /)
  b = eoshift(a, shift=sh, boundary=bo)
  w = reshape((/ -999, -999, -999, -99, 4, 5, -9, -9, -9 /), shape(b))
  do j=1,3
    do i=1,3
      if (w(i,j) /= b(i,j)) print *,i,j,w(i,j),b(i,j)
    end do
  end do
end program main
$ gfortran eoshift.f90
$ ./a.out
           1           2         -99 -1644167172
           1           3          -9    -6422529
           2           3          -9    -6422529
           3           3          -9    -6422529
$ gfortran -v
Using built-in specs.
Target: ia64-unknown-linux-gnu
Configured with: ../gcc-4.1-20050618/configure --prefix=/home/zfkts --enable-
languages=c,f95
Thread model: posix
gcc version 4.1.0 20050618 (experimental)
$ nm a.out | grep eoshift
                 U _gfortran_eoshift3_4

-- 
           Summary: eoshift: boundary not filled in correctly
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to