This is the mail archive of the gcc-patches@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]

[patch, committed] PR libfortran/22142


Committed as obvious.

	Thomas

2005-06-28  Thomas Koenig  <Thomas.Koenig@online.de>

        PR libfortran/22142
        * m4/eoshift3.m4:  Correct bstride (it needs to be multiplied
        by size since it's a char pointer).
        * m4/eoshift3_4.c:  Regenerated.
        * m4/eoshift3_8.c:  Regenerated.

2005-06-28  Thomas Koenig  <Thomas.Koenig@online.de>

        PR libfortran/22142
        * gfortran.fortran-torture/execute/intrinsic_eoshift.f90:
        Add testcase for PR 22142.

Index: libgfortran/m4/eoshift3.m4
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/m4/eoshift3.m4,v
retrieving revision 1.9
diff -c -p -r1.9 eoshift3.m4
*** libgfortran/m4/eoshift3.m4  25 Jun 2005 09:56:32 -0000      1.9
--- libgfortran/m4/eoshift3.m4  28 Jun 2005 21:54:13 -0000
*************** eoshift3_`'atype_kind (gfc_array_char *r
*** 136,142 ****

            hstride[n] = h->dim[n].stride;
            if (bound)
!             bstride[n] = bound->dim[n].stride;
            else
              bstride[n] = 0;
            n++;
--- 136,142 ----

            hstride[n] = h->dim[n].stride;
            if (bound)
!             bstride[n] = bound->dim[n].stride * size;
            else
              bstride[n] = 0;
            n++;
Index: gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_eoshift.f90
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_eoshift.f90,v
retrieving revision 1.2
diff -c -p -r1.2 intrinsic_eoshift.f90
*** gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_eoshift.f90       13 May 2004 06:40:53 -0000       1.2
--- gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_eoshift.f90       28 Jun 2005 21:54:13 -0000
***************
*** 2,7 ****
--- 2,8 ----
  program intrinsic_eoshift
     integer, dimension(3, 3) :: a
     integer, dimension(3, 3, 2) :: b
+    integer, dimension(3) :: bo, sh

     ! Scalar shift and scalar bound.
     a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))
*************** program intrinsic_eoshift
*** 47,52 ****
--- 48,60 ----
     if (any (a .ne. reshape ((/7, -1, 3, 99, -1, 6, 99, 2, 9/), (/3, 3/)))) &
        call abort

+    a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))
+    sh = (/ 3, -1, -3 /)
+    bo = (/-999, -99, -9 /)
+    a = eoshift(a, shift=sh, boundary=bo)
+    if (any (a .ne. reshape ((/ -999, -999, -999, -99, 4, 5, -9, -9, -9 /), &
+         shape(a)))) call abort
+
     ! Test arrays > rank 2
     b(:, :, 1) = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))
     b(:, :, 2) = 10 + reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))


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