diff options
author | tkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-25 09:56:37 +0000 |
---|---|---|
committer | tkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-25 09:56:37 +0000 |
commit | 71a8a4b3c9e5898168f8833055596815ff640796 (patch) | |
tree | 0bfeede6e9240f3c069b66974e9813ec2385f821 /libgfortran/generated/eoshift3_4.c | |
parent | 67ce556b47830dd825524e8370969b814c355216 (diff) | |
download | gcc-71a8a4b3c9e5898168f8833055596815ff640796.tar.gz |
2005-06-25 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/22144
* m4/cshift1.m4: Remove const from argument ret.
Populate return array descriptor if ret->data is NULL.
* m4/eoshift1.m4: Likewise.
* m4/eoshift3.m4: Likewise.
* generated/cshift1_4.c: Regenerated.
* generated/cshift1_8.c: Regenerated.
* generated/eoshift1_4.c: Regenerated.
* generated/eoshift1_8.c: Regenerated.
* generated/eoshift3_4.c: Regenerated.
* generated/eoshift3_8.c: Regenerated.
2005-06-25 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/21144
* gfortran.dg/shift-alloc.f90: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101318 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/generated/eoshift3_4.c')
-rw-r--r-- | libgfortran/generated/eoshift3_4.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libgfortran/generated/eoshift3_4.c b/libgfortran/generated/eoshift3_4.c index 964d98b55ed..14c38b7bd6a 100644 --- a/libgfortran/generated/eoshift3_4.c +++ b/libgfortran/generated/eoshift3_4.c @@ -90,6 +90,25 @@ eoshift3_4 (gfc_array_char *ret, gfc_array_char *array, which = 0; size = GFC_DESCRIPTOR_SIZE (ret); + if (ret->data == NULL) + { + int i; + + ret->data = internal_malloc_size (size * size0 ((array_t *)array)); + ret->base = 0; + ret->dtype = array->dtype; + for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) + { + ret->dim[i].lbound = 0; + ret->dim[i].ubound = array->dim[i].ubound - array->dim[i].lbound; + + if (i == 0) + ret->dim[i].stride = 1; + else + ret->dim[i].stride = (ret->dim[i-1].ubound + 1) * ret->dim[i-1].stride; + } + } + extent[0] = 1; count[0] = 0; |