re PR libfortran/22142 ([4.0 only] eoshift: boundary not filled in correctly)
authorThomas Koenig <Thomas.Koenig@online.de>
Tue, 28 Jun 2005 21:57:45 +0000 (21:57 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Tue, 28 Jun 2005 21:57:45 +0000 (21:57 +0000)
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.

From-SVN: r101392

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_eoshift.f90
libgfortran/ChangeLog
libgfortran/generated/eoshift3_4.c
libgfortran/generated/eoshift3_8.c
libgfortran/m4/eoshift3.m4

index 1794a3bd2688af891be9cd52c7467f541d233bb4..dfed3d3beb73d0eb0cc2d9ab027c8d93348c9de2 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-28  Thomas Koenig  <Thomas.Koenig@online.de>
+
+        PR libfortran/22142
+       * gfortran.fortran-torture/execute/intrinsic_eoshift.f90:
+       Add testcase for PR 22142.
+
 2005-06-28  Joseph S. Myers  <joseph@codesourcery.com>
 
        * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c,
index 12edc630e50bbe494e6aef2529f883705da83ec5..a607baa5ba5e2f00f873fd3ff5d2d4d4fbf88756 100644 (file)
@@ -2,6 +2,7 @@
 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/))
@@ -47,6 +48,13 @@ program intrinsic_eoshift
    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 41a545f1df3d681d84725416d117e03af506251e..f7c2d5c3617af48c83a17e5ef269b897c26b7765 100644 (file)
@@ -1,3 +1,11 @@
+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  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
 
        PR libfortran/22170
index 14c38b7bd6ae93c3838de00d87c978b201da54d0..4ce66a3059ada10db42e3da968c04937bc9bdb46 100644 (file)
@@ -135,7 +135,7 @@ eoshift3_4 (gfc_array_char *ret, gfc_array_char *array,
 
           hstride[n] = h->dim[n].stride;
           if (bound)
-            bstride[n] = bound->dim[n].stride;
+            bstride[n] = bound->dim[n].stride * size;
           else
             bstride[n] = 0;
           n++;
index 77617b074172cef8e1f5d00aaff0d4acdd7379db..7e9b911b1a6b8f8ebb7a152bda30fae514b4f586 100644 (file)
@@ -135,7 +135,7 @@ eoshift3_8 (gfc_array_char *ret, gfc_array_char *array,
 
           hstride[n] = h->dim[n].stride;
           if (bound)
-            bstride[n] = bound->dim[n].stride;
+            bstride[n] = bound->dim[n].stride * size;
           else
             bstride[n] = 0;
           n++;
index 5001756df0cfc7a5050f5c7c15ffcdb66fcd1019..24b21cd1531ceaf05c1f8fcd2835ffd6c65c284a 100644 (file)
@@ -136,7 +136,7 @@ eoshift3_`'atype_kind (gfc_array_char *ret, gfc_array_char *array,
 
           hstride[n] = h->dim[n].stride;
           if (bound)
-            bstride[n] = bound->dim[n].stride;
+            bstride[n] = bound->dim[n].stride * size;
           else
             bstride[n] = 0;
           n++;