https://gcc.gnu.org/g:9bd3219abe8f10d352c6376a25f4afe6e9255d7a
commit 9bd3219abe8f10d352c6376a25f4afe6e9255d7a Author: Mikael Morin <[email protected]> Date: Sun Sep 7 17:37:35 2025 +0200 Remplacement macro GFC_DIMENSION_SET -> GFC_DESCRIPTOR_DIMENSION_SET Diff: --- libgfortran/intrinsics/cshift0.c | 2 +- libgfortran/intrinsics/date_and_time.c | 2 +- libgfortran/intrinsics/eoshift0.c | 2 +- libgfortran/intrinsics/eoshift2.c | 2 +- libgfortran/intrinsics/move_alloc.c | 10 +++++----- libgfortran/intrinsics/pack_generic.c | 4 ++-- libgfortran/intrinsics/reduce.c | 2 +- libgfortran/intrinsics/reshape_generic.c | 2 +- libgfortran/intrinsics/spread_generic.c | 4 ++-- libgfortran/intrinsics/unpack_generic.c | 4 ++-- libgfortran/io/format.c | 4 ++-- libgfortran/io/list_read.c | 4 ++-- libgfortran/io/transfer.c | 2 +- libgfortran/io/write.c | 4 ++-- libgfortran/libgfortran.h | 9 ++++----- libgfortran/m4/bessel.m4 | 4 ++-- libgfortran/m4/cshift1.m4 | 2 +- libgfortran/m4/eoshift1.m4 | 3 +-- libgfortran/m4/eoshift3.m4 | 3 +-- libgfortran/m4/ifindloc0.m4 | 6 +++--- libgfortran/m4/ifindloc1.m4 | 8 +++----- libgfortran/m4/iforeach-s.m4 | 6 +++--- libgfortran/m4/iforeach.m4 | 6 +++--- libgfortran/m4/ifunction-s.m4 | 9 +++------ libgfortran/m4/ifunction-s2.m4 | 9 +++------ libgfortran/m4/ifunction.m4 | 9 +++------ libgfortran/m4/ifunction_logical.m4 | 3 +-- libgfortran/m4/matmul_internal.m4 | 18 +++++++++--------- libgfortran/m4/matmull.m4 | 18 +++++++++--------- libgfortran/m4/pack.m4 | 2 +- libgfortran/m4/reshape.m4 | 2 +- libgfortran/m4/shape.m4 | 2 +- libgfortran/m4/spread.m4 | 4 ++-- libgfortran/m4/unpack.m4 | 8 ++++---- 34 files changed, 82 insertions(+), 97 deletions(-) diff --git a/libgfortran/intrinsics/cshift0.c b/libgfortran/intrinsics/cshift0.c index 70f82e0c2508..a490f81b8aee 100644 --- a/libgfortran/intrinsics/cshift0.c +++ b/libgfortran/intrinsics/cshift0.c @@ -74,7 +74,7 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array, str = GFC_DESCRIPTOR_EXTENT(ret,i-1) * GFC_DESCRIPTOR_STRIDE(ret,i-1); - GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); + GFC_DESCRIPTOR_DIMENSION_SET(ret, i, 0, ub, str); } /* xmallocarray allocates a single byte for zero size. */ diff --git a/libgfortran/intrinsics/date_and_time.c b/libgfortran/intrinsics/date_and_time.c index 0478c77a9314..a5042cb2bcf8 100644 --- a/libgfortran/intrinsics/date_and_time.c +++ b/libgfortran/intrinsics/date_and_time.c @@ -311,7 +311,7 @@ secnds (GFC_REAL_4 *x) GFC_DESCRIPTOR_DTYPE (avalues).type = BT_REAL; GFC_DESCRIPTOR_DTYPE (avalues).elem_len = 4; GFC_DESCRIPTOR_DTYPE (avalues).rank = 1; - GFC_DIMENSION_SET(avalues->dim[0], 0, 7, 1); + GFC_DESCRIPTOR_DIMENSION_SET(avalues, 0, 0, 7, 1); date_and_time (NULL, NULL, NULL, avalues, 0, 0, 0); diff --git a/libgfortran/intrinsics/eoshift0.c b/libgfortran/intrinsics/eoshift0.c index ccdd7cd4bffb..251971ecfb59 100644 --- a/libgfortran/intrinsics/eoshift0.c +++ b/libgfortran/intrinsics/eoshift0.c @@ -79,7 +79,7 @@ eoshift0 (gfc_array_char * ret, const gfc_array_char * array, str = GFC_DESCRIPTOR_EXTENT(ret,i-1) * GFC_DESCRIPTOR_STRIDE(ret,i-1); - GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); + GFC_DESCRIPTOR_DIMENSION_SET(ret, i, 0, ub, str); } diff --git a/libgfortran/intrinsics/eoshift2.c b/libgfortran/intrinsics/eoshift2.c index d3fa4b1d84cd..2ebd1d5164f4 100644 --- a/libgfortran/intrinsics/eoshift2.c +++ b/libgfortran/intrinsics/eoshift2.c @@ -89,7 +89,7 @@ eoshift2 (gfc_array_char *ret, const gfc_array_char *array, str = GFC_DESCRIPTOR_EXTENT(ret,i-1) * GFC_DESCRIPTOR_STRIDE(ret,i-1); - GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); + GFC_DESCRIPTOR_DIMENSION_SET(ret, i, 0, ub, str); } } else if (unlikely (compile_options.bounds_check)) diff --git a/libgfortran/intrinsics/move_alloc.c b/libgfortran/intrinsics/move_alloc.c index 194d598e7d09..d09665909eed 100644 --- a/libgfortran/intrinsics/move_alloc.c +++ b/libgfortran/intrinsics/move_alloc.c @@ -38,11 +38,11 @@ move_alloc (gfc_array_char * from, gfc_array_char * to) for (i = 0; i < GFC_DESCRIPTOR_RANK (from); i++) { - GFC_DIMENSION_SET(to->dim[i],GFC_DESCRIPTOR_LBOUND(from,i), - GFC_DESCRIPTOR_UBOUND(from,i), - GFC_DESCRIPTOR_STRIDE(from,i)); - GFC_DIMENSION_SET(from->dim[i],GFC_DESCRIPTOR_LBOUND(from,i), - GFC_DESCRIPTOR_LBOUND(from,i), 0); + GFC_DESCRIPTOR_DIMENSION_SET(to, i, GFC_DESCRIPTOR_LBOUND(from,i), + GFC_DESCRIPTOR_UBOUND(from,i), + GFC_DESCRIPTOR_STRIDE(from,i)); + GFC_DESCRIPTOR_DIMENSION_SET(from, i, GFC_DESCRIPTOR_LBOUND(from,i), + GFC_DESCRIPTOR_LBOUND(from,i), 0); } to->offset = from->offset; diff --git a/libgfortran/intrinsics/pack_generic.c b/libgfortran/intrinsics/pack_generic.c index 3de2a9f453b2..37cb52ecfa3a 100644 --- a/libgfortran/intrinsics/pack_generic.c +++ b/libgfortran/intrinsics/pack_generic.c @@ -159,7 +159,7 @@ pack_internal (gfc_array_char *ret, const gfc_array_char *array, if (ret->base_addr == NULL) { /* Setup the array descriptor. */ - GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, total-1, 1); ret->offset = 0; /* xmallocarray allocates a single byte for zero size. */ @@ -535,7 +535,7 @@ pack_s_internal (gfc_array_char *ret, const gfc_array_char *array, } /* Setup the array descriptor. */ - GFC_DIMENSION_SET(ret->dim[0],0,total-1,1); + GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, total-1, 1); ret->offset = 0; diff --git a/libgfortran/intrinsics/reduce.c b/libgfortran/intrinsics/reduce.c index 256394f08501..aa391fb1373d 100644 --- a/libgfortran/intrinsics/reduce.c +++ b/libgfortran/intrinsics/reduce.c @@ -129,7 +129,7 @@ reduce (parray *ret, if (i != (int)dimen_m1) { str = GFC_DESCRIPTOR_STRIDE (array, j); - GFC_DIMENSION_SET (ret->dim[j], 0, ext - 1, str); + GFC_DESCRIPTOR_DIMENSION_SET (ret, j, 0, ext - 1, str); j++; } } diff --git a/libgfortran/intrinsics/reshape_generic.c b/libgfortran/intrinsics/reshape_generic.c index f65b804f42c2..1aa47bb9d8ee 100644 --- a/libgfortran/intrinsics/reshape_generic.c +++ b/libgfortran/intrinsics/reshape_generic.c @@ -94,7 +94,7 @@ reshape_internal (parray *ret, parray *source, shape_type *shape, { rex = shape_data[n]; - GFC_DIMENSION_SET(ret->dim[n],0,rex - 1,rs); + GFC_DESCRIPTOR_DIMENSION_SET(ret, n, 0, rex - 1, rs); rs *= rex; } diff --git a/libgfortran/intrinsics/spread_generic.c b/libgfortran/intrinsics/spread_generic.c index 3fe1b503a707..1b9275d9e8f0 100644 --- a/libgfortran/intrinsics/spread_generic.c +++ b/libgfortran/intrinsics/spread_generic.c @@ -98,7 +98,7 @@ spread_internal (gfc_array_char *ret, const gfc_array_char *source, dim++; } - GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride); + GFC_DESCRIPTOR_DIMENSION_SET(ret, n, 0, ub, stride); } ret->offset = 0; ret->base_addr = xmallocarray (rs, size); @@ -248,7 +248,7 @@ spread_internal_scalar (gfc_array_char *ret, const char *source, { ret->base_addr = xmallocarray (ncopies, size); ret->offset = 0; - GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, ncopies - 1, 1); } else { diff --git a/libgfortran/intrinsics/unpack_generic.c b/libgfortran/intrinsics/unpack_generic.c index ffbad1abf5aa..f830dc68377f 100644 --- a/libgfortran/intrinsics/unpack_generic.c +++ b/libgfortran/intrinsics/unpack_generic.c @@ -114,8 +114,8 @@ unpack_internal (gfc_array_char *ret, const gfc_array_char *vector, for (n = 0; n < dim; n++) { count[n] = 0; - GFC_DIMENSION_SET(ret->dim[n], 0, - GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs); + GFC_DESCRIPTOR_DIMENSION_SET(ret, n, 0, + GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs); extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n); empty = empty || extent[n] <= 0; rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret, n); diff --git a/libgfortran/io/format.c b/libgfortran/io/format.c index 87e21a9a4327..6d2cb508aac7 100644 --- a/libgfortran/io/format.c +++ b/libgfortran/io/format.c @@ -1080,7 +1080,7 @@ parse_format_list (st_parameter_dt *dtp, bool *seen_dd) tail->u.udf.vlist= xmalloc (sizeof(gfc_array_i4) + sizeof (descriptor_dimension)); GFC_DESCRIPTOR_DATA(tail->u.udf.vlist) = NULL; - GFC_DIMENSION_SET(tail->u.udf.vlist->dim[0],1, 0, 0); + GFC_DESCRIPTOR_DIMENSION_SET(tail->u.udf.vlist, 0, 1, 0, 0); if (t == FMT_STRING) { @@ -1112,7 +1112,7 @@ parse_format_list (st_parameter_dt *dtp, bool *seen_dd) array descriptor and save it in the format node. */ gfc_full_array_i4 *vp = tail->u.udf.vlist; GFC_DESCRIPTOR_DATA(vp) = xmalloc (i * sizeof(GFC_INTEGER_4)); - GFC_DIMENSION_SET(vp->dim[0],1, i, 1); + GFC_DESCRIPTOR_DIMENSION_SET(vp, 0, 1, i, 1); memcpy (GFC_DESCRIPTOR_DATA(vp), temp, i * sizeof(GFC_INTEGER_4)); break; } diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index 7c22f61e5a70..dcc5619d1324 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -2386,7 +2386,7 @@ list_formatted_read_scalar (st_parameter_dt *dtp, bt type, void *p, gfc_full_array_i4 vlist; GFC_DESCRIPTOR_DATA(&vlist) = NULL; - GFC_DIMENSION_SET(vlist.dim[0],1, 0, 0); + GFC_DESCRIPTOR_DIMENSION_SET(&vlist, 0, 1, 0, 0); /* Set iostat, intent(out). */ noiostat = 0; @@ -3201,7 +3201,7 @@ nml_read_obj (st_parameter_dt *dtp, namelist_info *nl, index_type offset, formatted_dtio dtio_ptr = (formatted_dtio)nl->dtio_sub; GFC_DESCRIPTOR_DATA(&vlist) = NULL; - GFC_DIMENSION_SET(vlist.dim[0],1, 0, 0); + GFC_DESCRIPTOR_DIMENSION_SET(&vlist, 0, 1, 0, 0); list_obj.vptr = nl->vtable; list_obj.len = 0; diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 3fc53938b4a2..7f4941271836 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -4939,7 +4939,7 @@ st_set_nml_var_dim (st_parameter_dt *dtp, GFC_INTEGER_4 n_dim, for (nml = dtp->u.p.ionml; nml->next; nml = nml->next); - GFC_DIMENSION_SET(nml->dim[n],lbound,ubound,stride); + GFC_DESCRIPTOR_DIMENSION_SET(nml, n, lbound, ubound, stride); } diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c index b36c5bef09e9..9ffa8426f729 100644 --- a/libgfortran/io/write.c +++ b/libgfortran/io/write.c @@ -2149,7 +2149,7 @@ list_formatted_write_scalar (st_parameter_dt *dtp, bt type, void *p, int kind, gfc_full_array_i4 vlist; GFC_DESCRIPTOR_DATA(&vlist) = NULL; - GFC_DIMENSION_SET(vlist.dim[0],1, 0, 0); + GFC_DESCRIPTOR_DIMENSION_SET(&vlist, 0, 1, 0, 0); /* Set iostat, intent(out). */ noiostat = 0; @@ -2487,7 +2487,7 @@ nml_write_obj (st_parameter_dt *dtp, namelist_info *obj, index_type offset, gfc_full_array_i4 vlist; formatted_dtio dtio_ptr = (formatted_dtio)obj->dtio_sub; - GFC_DIMENSION_SET(vlist.dim[0],1, 0, 0); + GFC_DESCRIPTOR_DIMENSION_SET(&vlist, 0, 1, 0, 0); /* Set iostat, intent(out). */ noiostat = 0; diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h index 25c3cb6641c3..afa2cc43ecd6 100644 --- a/libgfortran/libgfortran.h +++ b/libgfortran/libgfortran.h @@ -467,13 +467,12 @@ typedef GFC_FULL_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_INTEGER_4) gfc_full_a #define GFC_DIMENSION_LBOUND(dim) ((dim).lower_bound) #define GFC_DIMENSION_UBOUND(dim) ((dim)._ubound) #define GFC_DIMENSION_STRIDE(dim) ((dim)._stride) -#define GFC_DIMENSION_EXTENT(dim) ((dim)._ubound + 1 - (dim).lower_bound) -#define GFC_DIMENSION_SET(dim,lb,ub,str) \ +#define GFC_DESCRIPTOR_DIMENSION_SET(desc,i,lb,ub,str) \ do \ { \ - (dim).lower_bound = lb; \ - (dim)._ubound = ub; \ - (dim)._stride = str; \ + (desc)->dim[i].lower_bound = lb; \ + (desc)->dim[i]._ubound = ub; \ + (desc)->dim[i]._stride = str; \ } while (0) diff --git a/libgfortran/m4/bessel.m4 b/libgfortran/m4/bessel.m4 index a8c30f5f69ed..39da523884af 100644 --- a/libgfortran/m4/bessel.m4 +++ b/libgfortran/m4/bessel.m4 @@ -53,7 +53,7 @@ bessel_jn_r'rtype_kind` ('rtype` * const restrict ret, int n1, int n2, 'rtype_na if (ret->base_addr == NULL) { size_t size = n2 < n1 ? 0 : n2-n1+1; - GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, size-1, 1); ret->base_addr = xmallocarray (size, sizeof ('rtype_name`)); ret->offset = 0; } @@ -120,7 +120,7 @@ bessel_yn_r'rtype_kind` ('rtype` * const restrict ret, int n1, int n2, if (ret->base_addr == NULL) { size_t size = n2 < n1 ? 0 : n2-n1+1; - GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, size-1, 1); ret->base_addr = xmallocarray (size, sizeof ('rtype_name`)); ret->offset = 0; } diff --git a/libgfortran/m4/cshift1.m4 b/libgfortran/m4/cshift1.m4 index 5368ef4127bf..d954b6ca70b1 100644 --- a/libgfortran/m4/cshift1.m4 +++ b/libgfortran/m4/cshift1.m4 @@ -93,7 +93,7 @@ cshift1 (gfc_array_char * const restrict ret, str = GFC_DESCRIPTOR_EXTENT(ret,i-1) * GFC_DESCRIPTOR_STRIDE(ret,i-1); - GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); + GFC_DESCRIPTOR_DIMENSION_SET(ret, i, 0, ub, str); } } else if (unlikely (compile_options.bounds_check)) diff --git a/libgfortran/m4/eoshift1.m4 b/libgfortran/m4/eoshift1.m4 index d61038f0e1f5..f878894c6240 100644 --- a/libgfortran/m4/eoshift1.m4 +++ b/libgfortran/m4/eoshift1.m4 @@ -99,8 +99,7 @@ eoshift1 (gfc_array_char * const restrict ret, str = GFC_DESCRIPTOR_EXTENT(ret,i-1) * GFC_DESCRIPTOR_STRIDE(ret,i-1); - GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); - + GFC_DESCRIPTOR_DIMENSION_SET(ret, i, 0, ub, str); } /* xmallocarray allocates a single byte for zero size. */ ret->base_addr = xmallocarray (arraysize, size); diff --git a/libgfortran/m4/eoshift3.m4 b/libgfortran/m4/eoshift3.m4 index 48396c4b84a2..6e877e82f910 100644 --- a/libgfortran/m4/eoshift3.m4 +++ b/libgfortran/m4/eoshift3.m4 @@ -101,8 +101,7 @@ eoshift3 (gfc_array_char * const restrict ret, str = GFC_DESCRIPTOR_EXTENT(ret,i-1) * GFC_DESCRIPTOR_STRIDE(ret,i-1); - GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); - + GFC_DESCRIPTOR_DIMENSION_SET(ret, i, 0, ub, str); } /* xmallocarray allocates a single byte for zero size. */ ret->base_addr = xmallocarray (arraysize, size); diff --git a/libgfortran/m4/ifindloc0.m4 b/libgfortran/m4/ifindloc0.m4 index 1ef871631c03..47f311f84d78 100644 --- a/libgfortran/m4/ifindloc0.m4 +++ b/libgfortran/m4/ifindloc0.m4 @@ -45,7 +45,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see if (retarray->base_addr == NULL) { - GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; retarray->base_addr = xmallocarray (rank, sizeof (index_type)); @@ -176,7 +176,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see if (retarray->base_addr == NULL) { - GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; retarray->base_addr = xmallocarray (rank, sizeof (index_type)); @@ -330,7 +330,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see if (retarray->base_addr == NULL) { - GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; retarray->base_addr = xmallocarray (rank, sizeof (index_type)); diff --git a/libgfortran/m4/ifindloc1.m4 b/libgfortran/m4/ifindloc1.m4 index cb96ab5d7436..9525152489c4 100644 --- a/libgfortran/m4/ifindloc1.m4 +++ b/libgfortran/m4/ifindloc1.m4 @@ -86,8 +86,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see else str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1]; - GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); - + GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str); } retarray->offset = 0; @@ -260,8 +259,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see else str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1]; - GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); - + GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str); } retarray->offset = 0; @@ -420,7 +418,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see else str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1]; - GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str); } retarray->offset = 0; diff --git a/libgfortran/m4/iforeach-s.m4 b/libgfortran/m4/iforeach-s.m4 index b841d1519c5b..b66c63201b6a 100644 --- a/libgfortran/m4/iforeach-s.m4 +++ b/libgfortran/m4/iforeach-s.m4 @@ -36,7 +36,7 @@ name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray, if (retarray->base_addr == NULL) { - GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; retarray->base_addr = xmallocarray (rank, sizeof (rtype_name)); @@ -151,7 +151,7 @@ m'name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray, if (retarray->base_addr == NULL) { - GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1); retarray->dtype.rank = 1; retarray->offset = 0; retarray->base_addr = xmallocarray (rank, sizeof (rtype_name)); @@ -288,7 +288,7 @@ void if (retarray->base_addr == NULL) { - GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; retarray->base_addr = xmallocarray (rank, sizeof (rtype_name)); diff --git a/libgfortran/m4/iforeach.m4 b/libgfortran/m4/iforeach.m4 index ede4a7faf4aa..41e92e9d1b9d 100644 --- a/libgfortran/m4/iforeach.m4 +++ b/libgfortran/m4/iforeach.m4 @@ -27,7 +27,7 @@ name`'rtype_qual`_'atype_code (rtype * const restrict retarray, if (retarray->base_addr == NULL) { - GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; retarray->base_addr = xmallocarray (rank, sizeof (rtype_name)); @@ -136,7 +136,7 @@ void if (retarray->base_addr == NULL) { - GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1); retarray->dtype.rank = 1; retarray->offset = 0; retarray->base_addr = xmallocarray (rank, sizeof (rtype_name)); @@ -267,7 +267,7 @@ void if (retarray->base_addr == NULL) { - GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; retarray->base_addr = xmallocarray (rank, sizeof (rtype_name)); diff --git a/libgfortran/m4/ifunction-s.m4 b/libgfortran/m4/ifunction-s.m4 index 22182e9de279..ae4cb8886cb2 100644 --- a/libgfortran/m4/ifunction-s.m4 +++ b/libgfortran/m4/ifunction-s.m4 @@ -98,8 +98,7 @@ void else str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1]; - GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); - + GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str); } retarray->offset = 0; @@ -289,8 +288,7 @@ m'name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray, else str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1]; - GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); - + GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str); } alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; @@ -446,8 +444,7 @@ s'name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray, else str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1]; - GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); - + GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str); } retarray->offset = 0; diff --git a/libgfortran/m4/ifunction-s2.m4 b/libgfortran/m4/ifunction-s2.m4 index 4189dd9e2d8f..c9f2a74d566f 100644 --- a/libgfortran/m4/ifunction-s2.m4 +++ b/libgfortran/m4/ifunction-s2.m4 @@ -99,8 +99,7 @@ name`'rtype_qual`_'atype_code (rtype * const restrict retarray, else str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1]; - GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); - + GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str); } retarray->offset = 0; @@ -289,8 +288,7 @@ void else str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1]; - GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); - + GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str); } alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1] @@ -447,8 +445,7 @@ void else str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1]; - GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); - + GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str); } retarray->offset = 0; diff --git a/libgfortran/m4/ifunction.m4 b/libgfortran/m4/ifunction.m4 index 101175ef5ff8..5bb1d303ae17 100644 --- a/libgfortran/m4/ifunction.m4 +++ b/libgfortran/m4/ifunction.m4 @@ -85,8 +85,7 @@ name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray, else str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1]; - GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); - + GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str); } retarray->offset = 0; @@ -277,8 +276,7 @@ m'name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray, else str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1]; - GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); - + GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str); } alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; @@ -435,8 +433,7 @@ void else str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1]; - GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); - + GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str); } retarray->offset = 0; diff --git a/libgfortran/m4/ifunction_logical.m4 b/libgfortran/m4/ifunction_logical.m4 index 5fd776368b3b..032aa21b5327 100644 --- a/libgfortran/m4/ifunction_logical.m4 +++ b/libgfortran/m4/ifunction_logical.m4 @@ -82,8 +82,7 @@ name`'rtype_qual`_'atype_code (rtype * const restrict retarray, else str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1]; - GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); - + GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str); } retarray->offset = 0; diff --git a/libgfortran/m4/matmul_internal.m4 b/libgfortran/m4/matmul_internal.m4 index 20b1a486a4a8..d1ab0e06ce6c 100644 --- a/libgfortran/m4/matmul_internal.m4 +++ b/libgfortran/m4/matmul_internal.m4 @@ -28,22 +28,22 @@ { if (GFC_DESCRIPTOR_RANK (a) == 1) { - GFC_DIMENSION_SET(retarray->dim[0], 0, - GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, + GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1); } else if (GFC_DESCRIPTOR_RANK (b) == 1) { - GFC_DIMENSION_SET(retarray->dim[0], 0, - GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, + GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1); } else { - GFC_DIMENSION_SET(retarray->dim[0], 0, - GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, + GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1); - GFC_DIMENSION_SET(retarray->dim[1], 0, - GFC_DESCRIPTOR_EXTENT(b,1) - 1, - GFC_DESCRIPTOR_EXTENT(retarray,0)); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0, + GFC_DESCRIPTOR_EXTENT(b,1) - 1, + GFC_DESCRIPTOR_EXTENT(retarray,0)); } retarray->base_addr diff --git a/libgfortran/m4/matmull.m4 b/libgfortran/m4/matmull.m4 index ab0a1ba39891..52134a347479 100644 --- a/libgfortran/m4/matmull.m4 +++ b/libgfortran/m4/matmull.m4 @@ -69,22 +69,22 @@ matmul_'rtype_code` ('rtype` * const restrict retarray, { if (GFC_DESCRIPTOR_RANK (a) == 1) { - GFC_DIMENSION_SET(retarray->dim[0], 0, - GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, + GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1); } else if (GFC_DESCRIPTOR_RANK (b) == 1) { - GFC_DIMENSION_SET(retarray->dim[0], 0, - GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, + GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1); } else { - GFC_DIMENSION_SET(retarray->dim[0], 0, - GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, + GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1); - GFC_DIMENSION_SET(retarray->dim[1], 0, - GFC_DESCRIPTOR_EXTENT(b,1) - 1, - GFC_DESCRIPTOR_EXTENT(retarray,0)); + GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0, + GFC_DESCRIPTOR_EXTENT(b,1) - 1, + GFC_DESCRIPTOR_EXTENT(retarray,0)); } retarray->base_addr diff --git a/libgfortran/m4/pack.m4 b/libgfortran/m4/pack.m4 index 75863ec7da76..1e94fc8416b6 100644 --- a/libgfortran/m4/pack.m4 +++ b/libgfortran/m4/pack.m4 @@ -165,7 +165,7 @@ pack_'rtype_code` ('rtype` *ret, const 'rtype` *array, if (ret->base_addr == NULL) { /* Setup the array descriptor. */ - GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, total-1, 1); ret->offset = 0; diff --git a/libgfortran/m4/reshape.m4 b/libgfortran/m4/reshape.m4 index 705a102c357d..ee1547e91282 100644 --- a/libgfortran/m4/reshape.m4 +++ b/libgfortran/m4/reshape.m4 @@ -108,7 +108,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret, { rex = shape_data[n]; - GFC_DIMENSION_SET(ret->dim[n], 0, rex - 1, rs); + GFC_DESCRIPTOR_DIMENSION_SET(ret, n, 0, rex - 1, rs); rs *= rex; } diff --git a/libgfortran/m4/shape.m4 b/libgfortran/m4/shape.m4 index a392e7527dd5..82b13fd04fea 100644 --- a/libgfortran/m4/shape.m4 +++ b/libgfortran/m4/shape.m4 @@ -44,7 +44,7 @@ shape_'rtype_kind` ('rtype` * const restrict ret, if (ret->base_addr == NULL) { - GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, rank - 1, 1); ret->offset = 0; ret->base_addr = xmallocarray (rank, sizeof ('rtype_name`)); } diff --git a/libgfortran/m4/spread.m4 b/libgfortran/m4/spread.m4 index 67f4261f3c8c..d8ca85ed2894 100644 --- a/libgfortran/m4/spread.m4 +++ b/libgfortran/m4/spread.m4 @@ -99,7 +99,7 @@ spread_'rtype_code` ('rtype` *ret, const 'rtype` *source, rs *= extent[dim]; dim++; } - GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride); + GFC_DESCRIPTOR_DIMENSION_SET(ret, n, 0, ub, stride); } ret->offset = 0; @@ -246,7 +246,7 @@ spread_scalar_'rtype_code` ('rtype` *ret, const 'rtype_name` *source, { ret->base_addr = xmallocarray (ncopies, sizeof ('rtype_name`)); ret->offset = 0; - GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1); + GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, ncopies - 1, 1); } else { diff --git a/libgfortran/m4/unpack.m4 b/libgfortran/m4/unpack.m4 index 5f0321cac3d4..16b0066e5200 100644 --- a/libgfortran/m4/unpack.m4 +++ b/libgfortran/m4/unpack.m4 @@ -91,8 +91,8 @@ unpack0_'rtype_code` ('rtype` *ret, const 'rtype` *vector, for (n = 0; n < dim; n++) { count[n] = 0; - GFC_DIMENSION_SET(ret->dim[n], 0, - GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs); + GFC_DESCRIPTOR_DIMENSION_SET(ret, n, 0, + GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs); extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n); empty = empty || extent[n] <= 0; rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n); @@ -237,8 +237,8 @@ unpack1_'rtype_code` ('rtype` *ret, const 'rtype` *vector, for (n = 0; n < dim; n++) { count[n] = 0; - GFC_DIMENSION_SET(ret->dim[n], 0, - GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs); + GFC_DESCRIPTOR_DIMENSION_SET(ret, n, 0, + GFC_DESCRIPTOR_EXTENT(mask,n) - 1, rs); extent[n] = GFC_DESCRIPTOR_EXTENT(ret,n); empty = empty || extent[n] <= 0; rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,n);
