From 201cd10314ccacb5e43ee1708e61c3988b23a156 Mon Sep 17 00:00:00 2001 From: tkoenig Date: Tue, 28 Jun 2005 23:07:20 +0000 Subject: [PATCH 1/1] 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101398 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 6 ++++++ .../gfortran.fortran-torture/execute/intrinsic_eoshift.f90 | 6 ++++++ libgfortran/ChangeLog | 8 ++++++++ libgfortran/generated/eoshift1_4.c | 2 +- libgfortran/generated/eoshift1_8.c | 2 +- libgfortran/m4/eoshift1.m4 | 2 +- 6 files changed, 23 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 62cdacc3a40..3f6a4c5e4fe 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 a607baa5ba5..872422d2f08 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 f7c2d5c3617..ac02fb7ee4e 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,6 +1,14 @@ 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 * m4/eoshift3.m4: Correct bstride (it needs to be multiplied by size since it's a char pointer). * m4/eoshift3_4.c: Regenerated. diff --git a/libgfortran/generated/eoshift1_4.c b/libgfortran/generated/eoshift1_4.c index 833efa2ae00..cb4dfb5547b 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 75d0f1e1e3d..379cb4a1b50 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 1d13f482081..906687ac7ca 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++; } } -- 2.11.0