summaryrefslogtreecommitdiff
path: root/libgfortran/generated/cshift1_4.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/generated/cshift1_4.c')
-rw-r--r--libgfortran/generated/cshift1_4.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/libgfortran/generated/cshift1_4.c b/libgfortran/generated/cshift1_4.c
index 5ea8a6acedd..4793e58f183 100644
--- a/libgfortran/generated/cshift1_4.c
+++ b/libgfortran/generated/cshift1_4.c
@@ -72,30 +72,27 @@ cshift1 (gfc_array_char * const restrict ret,
if (which < 0 || (which + 1) > GFC_DESCRIPTOR_RANK (array))
runtime_error ("Argument 'DIM' is out of range in call to 'CSHIFT'");
- size = GFC_DESCRIPTOR_SIZE(array);
+ size = GFC_DESCRIPTOR_ELEM_LEN(array);
arraysize = size0 ((array_t *)array);
if (ret->base_addr == NULL)
{
int i;
+ index_type sm, ext;
ret->base_addr = xmallocarray (arraysize, size);
+ ret->elem_len = array->elem_len;
+ ret->type = array->type;
ret->offset = 0;
- ret->dtype = array->dtype;
+ sm = sizeof (GFC_INTEGER_4);
+ ext = 1;
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
{
- index_type ub, str;
+ sm *= ext;
+ ext = GFC_DESCRIPTOR_EXTENT (array, i);
- ub = GFC_DESCRIPTOR_EXTENT(array,i) - 1;
-
- if (i == 0)
- str = 1;
- else
- str = GFC_DESCRIPTOR_EXTENT(ret,i-1) *
- GFC_DESCRIPTOR_STRIDE(ret,i-1);
-
- GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+ GFC_DIMENSION_SET (ret->dim[i], 0, ext, sm);
}
}
else if (unlikely (compile_options.bounds_check))
@@ -126,10 +123,10 @@ cshift1 (gfc_array_char * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ roffset = GFC_DESCRIPTOR_SM(ret,dim);
if (roffset == 0)
roffset = size;
- soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ soffset = GFC_DESCRIPTOR_SM(array,dim);
if (soffset == 0)
soffset = size;
len = GFC_DESCRIPTOR_EXTENT(array,dim);
@@ -138,10 +135,10 @@ cshift1 (gfc_array_char * const restrict ret,
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_SM(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_SM(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_TYPEKNOWN(h,n);
n++;
}
}