From: Thomas Koenig Date: Tue, 28 Jun 2005 23:07:20 +0000 (+0000) Subject: re PR libfortran/22142 ([4.0 only] eoshift: boundary not filled in correctly) X-Git-Tag: misc/cutover-cvs2svn~2093 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7f8f6d5f05abb9f672982718f549a6fa81bf7270;p=thirdparty%2Fgcc.git re PR libfortran/22142 ([4.0 only] eoshift: boundary not filled in correctly) 2005-06-28 Thomas Koenig PR libfortran/22142 * m4/eoshift1.m4: Correct bstride (it needs to be multiplied by size since it's a char pointer). * m4/eoshift1_4.c: Regenerated. * m4/eoshift1_8.c: Regenerated. 2005-06-28 Thomas Koenig PR libfortran/22142 * gfortran.fortran-torture/execute/intrinsic_eoshift.f90: Add testcase also testing eoshift1 for PR 22142. From-SVN: r101398 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 62cdacc3a407..3f6a4c5e4fe1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2005-06-28 Thomas Koenig + + PR libfortran/22142 + * gfortran.fortran-torture/execute/intrinsic_eoshift.f90: + Add testcase also testing eoshift1 for PR 22142. + 2005-06-28 Richard Henderson * gcc.dg/tree-ssa/20030708-1.c: Remove static from test function. diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_eoshift.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_eoshift.f90 index a607baa5ba5e..872422d2f086 100644 --- a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_eoshift.f90 +++ b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_eoshift.f90 @@ -37,6 +37,12 @@ program intrinsic_eoshift if (any (a .ne. reshape ((/99, -1, 42, 99, -1, 42, 1, 2, 3/), (/3, 3/)))) & call abort + a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/)) + bo = (/99, -1, 42/) + a = eoshift (a, -2, bo, 2) + if (any (a .ne. reshape ((/99, -1, 42, 99, -1, 42, 1, 2, 3/), (/3, 3/)))) & + call abort + ! Array shift and array bound. a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/)) a = eoshift (a, (/1, 0, -1/), (/99, -1, 42/), 1) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index f7c2d5c3617a..ac02fb7ee4e3 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,11 @@ +2005-06-28 Thomas Koenig + + PR libfortran/22142 + * m4/eoshift1.m4: Correct bstride (it needs to be multiplied + by size since it's a char pointer). + * m4/eoshift1_4.c: Regenerated. + * m4/eoshift1_8.c: Regenerated. + 2005-06-28 Thomas Koenig PR libfortran/22142 diff --git a/libgfortran/generated/eoshift1_4.c b/libgfortran/generated/eoshift1_4.c index 833efa2ae00a..cb4dfb5547b5 100644 --- a/libgfortran/generated/eoshift1_4.c +++ b/libgfortran/generated/eoshift1_4.c @@ -135,7 +135,7 @@ eoshift1_4 (gfc_array_char *ret, rstride[n] = ret->dim[dim].stride * size; sstride[n] = array->dim[dim].stride * size; - hstride[n] = h->dim[n].stride; + hstride[n] = h->dim[n].stride * size; n++; } } diff --git a/libgfortran/generated/eoshift1_8.c b/libgfortran/generated/eoshift1_8.c index 75d0f1e1e3d1..379cb4a1b50a 100644 --- a/libgfortran/generated/eoshift1_8.c +++ b/libgfortran/generated/eoshift1_8.c @@ -135,7 +135,7 @@ eoshift1_8 (gfc_array_char *ret, rstride[n] = ret->dim[dim].stride * size; sstride[n] = array->dim[dim].stride * size; - hstride[n] = h->dim[n].stride; + hstride[n] = h->dim[n].stride * size; n++; } } diff --git a/libgfortran/m4/eoshift1.m4 b/libgfortran/m4/eoshift1.m4 index 1d13f4820818..906687ac7ca4 100644 --- a/libgfortran/m4/eoshift1.m4 +++ b/libgfortran/m4/eoshift1.m4 @@ -136,7 +136,7 @@ eoshift1_`'atype_kind (gfc_array_char *ret, rstride[n] = ret->dim[dim].stride * size; sstride[n] = array->dim[dim].stride * size; - hstride[n] = h->dim[n].stride; + hstride[n] = h->dim[n].stride * size; n++; } }