From: Janne Blomqvist Date: Wed, 31 Jan 2018 14:16:22 +0000 (+0200) Subject: Use pointer sized array indices. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7a157266876058eee921323240e4bfd7e5a84fba;p=gcc.git Use pointer sized array indices. Using pointer sized variables (e.g. size_t / ptrdiff_t) when the variables are used as array indices allows accessing larger arrays, and can be a slight performance improvement due to no need for sign or zero extending, or masking. Regtested on x86_64-pc-linux-gnu. libgfortran/ChangeLog: 2018-01-31 Janne Blomqvist * generated/cshift1_16.c (cshift1): Regenerated. * generated/cshift1_4.c (cshift1): Regenerated. * generated/cshift1_8.c (cshift1): Regenerated. * generated/eoshift1_16.c (eoshift1): Regenerated. * generated/eoshift1_4.c (eoshift1): Regenerated. * generated/eoshift1_8.c (eoshift1): Regenerated. * generated/eoshift3_16.c (eoshift3): Regenerated. * generated/eoshift3_4.c (eoshift3): Regenerated. * generated/eoshift3_8.c (eoshift3): Regenerated. * generated/in_pack_c10.c (internal_pack_c10): Regenerated. * generated/in_pack_c16.c (internal_pack_c16): Regenerated. * generated/in_pack_c4.c (internal_pack_c4): Regenerated. * generated/in_pack_c8.c (internal_pack_c8): Regenerated. * generated/in_pack_i1.c (internal_pack_1): Regenerated. * generated/in_pack_i16.c (internal_pack_16): Regenerated. * generated/in_pack_i2.c (internal_pack_2): Regenerated. * generated/in_pack_i4.c (internal_pack_4): Regenerated. * generated/in_pack_i8.c (internal_pack_8): Regenerated. * generated/in_pack_r10.c (internal_pack_r10): Regenerated. * generated/in_pack_r16.c (internal_pack_r16): Regenerated. * generated/in_pack_r4.c (internal_pack_r4): Regenerated. * generated/in_pack_r8.c (internal_pack_r8): Regenerated. * generated/in_unpack_c10.c (internal_unpack_c10): Regenerated. * generated/in_unpack_c16.c (internal_unpack_c16): Regenerated. * generated/in_unpack_c4.c (internal_unpack_c4): Regenerated. * generated/in_unpack_c8.c (internal_unpack_c8): Regenerated. * generated/in_unpack_i1.c (internal_unpack_1): Regenerated. * generated/in_unpack_i16.c (internal_unpack_16): Regenerated. * generated/in_unpack_i2.c (internal_unpack_2): Regenerated. * generated/in_unpack_i4.c (internal_unpack_4): Regenerated. * generated/in_unpack_i8.c (internal_unpack_8): Regenerated. * generated/in_unpack_r10.c (internal_unpack_r10): Regenerated. * generated/in_unpack_r16.c (internal_unpack_r16): Regenerated. * generated/in_unpack_r4.c (internal_unpack_r4): Regenerated. * generated/in_unpack_r8.c (internal_unpack_r8): Regenerated. * generated/reshape_c10.c (reshape_c10): Regenerated. * generated/reshape_c16.c (reshape_c16): Regenerated. * generated/reshape_c4.c (reshape_c4): Regenerated. * generated/reshape_c8.c (reshape_c8): Regenerated. * generated/reshape_i16.c (reshape_16): Regenerated. * generated/reshape_i4.c (reshape_4): Regenerated. * generated/reshape_i8.c (reshape_8): Regenerated. * generated/reshape_r10.c (reshape_r10): Regenerated. * generated/reshape_r16.c (reshape_r16): Regenerated. * generated/reshape_r4.c (reshape_r4): Regenerated. * generated/reshape_r8.c (reshape_r8): Regenerated. * generated/shape_i1.c (shape_1): Regenerated. * generated/shape_i16.c (shape_16): Regenerated. * generated/shape_i2.c (shape_2): Regenerated. * generated/shape_i4.c (shape_4): Regenerated. * generated/shape_i8.c (shape_8): Regenerated. * generated/spread_c10.c (spread_scalar_c10): Regenerated. * generated/spread_c16.c (spread_scalar_c16): Regenerated. * generated/spread_c4.c (spread_scalar_c4): Regenerated. * generated/spread_c8.c (spread_scalar_c8): Regenerated. * generated/spread_i1.c (spread_scalar_i1): Regenerated. * generated/spread_i16.c (spread_scalar_i16): Regenerated. * generated/spread_i2.c (spread_scalar_i2): Regenerated. * generated/spread_i4.c (spread_scalar_i4): Regenerated. * generated/spread_i8.c (spread_scalar_i8): Regenerated. * generated/spread_r10.c (spread_scalar_r10): Regenerated. * generated/spread_r16.c (spread_scalar_r16): Regenerated. * generated/spread_r4.c (spread_scalar_r4): Regenerated. * generated/spread_r8.c (spread_scalar_r8): Regenerated. * intrinsics/random.c (jump): Use size_t for array index in loop. (getosrandom): Likewise. (arandom_r4): Make n an index_type. (arandom_r8): Likewise. (arandom_r10): Likewise. (arandom_r16): Likewise. (scramble_seed): Use size_t for array index in loop. * m4/cshift1.m4: Make i an index_type. * m4/eoshift1.m4: Likewise. * m4/eoshift3.m4: Likewise. * m4/in_pack.m4: Make n an index_type. * m4/in_unpack.m4: Likewise. * m4/reshape.m4: Make n and dim index_type's. * m4/shape.m4: Make n an index_type. * m4/spread.m4: Likewise, use index_type argument rather than copying to int. * runtime/bounds.c (bounds_ifunction_return): Make n an index_type. * runtime/in_pack_generic.c (internal_pack): Likewise. * runtime/in_unpack_generic.c (internal_unpack): Make n and size index_type's. From-SVN: r257234 --- diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index d5a330e5ede..77ae9f76809 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,91 @@ +2018-01-31 Janne Blomqvist + + * generated/cshift1_16.c (cshift1): Regenerated. + * generated/cshift1_4.c (cshift1): Regenerated. + * generated/cshift1_8.c (cshift1): Regenerated. + * generated/eoshift1_16.c (eoshift1): Regenerated. + * generated/eoshift1_4.c (eoshift1): Regenerated. + * generated/eoshift1_8.c (eoshift1): Regenerated. + * generated/eoshift3_16.c (eoshift3): Regenerated. + * generated/eoshift3_4.c (eoshift3): Regenerated. + * generated/eoshift3_8.c (eoshift3): Regenerated. + * generated/in_pack_c10.c (internal_pack_c10): Regenerated. + * generated/in_pack_c16.c (internal_pack_c16): Regenerated. + * generated/in_pack_c4.c (internal_pack_c4): Regenerated. + * generated/in_pack_c8.c (internal_pack_c8): Regenerated. + * generated/in_pack_i1.c (internal_pack_1): Regenerated. + * generated/in_pack_i16.c (internal_pack_16): Regenerated. + * generated/in_pack_i2.c (internal_pack_2): Regenerated. + * generated/in_pack_i4.c (internal_pack_4): Regenerated. + * generated/in_pack_i8.c (internal_pack_8): Regenerated. + * generated/in_pack_r10.c (internal_pack_r10): Regenerated. + * generated/in_pack_r16.c (internal_pack_r16): Regenerated. + * generated/in_pack_r4.c (internal_pack_r4): Regenerated. + * generated/in_pack_r8.c (internal_pack_r8): Regenerated. + * generated/in_unpack_c10.c (internal_unpack_c10): Regenerated. + * generated/in_unpack_c16.c (internal_unpack_c16): Regenerated. + * generated/in_unpack_c4.c (internal_unpack_c4): Regenerated. + * generated/in_unpack_c8.c (internal_unpack_c8): Regenerated. + * generated/in_unpack_i1.c (internal_unpack_1): Regenerated. + * generated/in_unpack_i16.c (internal_unpack_16): Regenerated. + * generated/in_unpack_i2.c (internal_unpack_2): Regenerated. + * generated/in_unpack_i4.c (internal_unpack_4): Regenerated. + * generated/in_unpack_i8.c (internal_unpack_8): Regenerated. + * generated/in_unpack_r10.c (internal_unpack_r10): Regenerated. + * generated/in_unpack_r16.c (internal_unpack_r16): Regenerated. + * generated/in_unpack_r4.c (internal_unpack_r4): Regenerated. + * generated/in_unpack_r8.c (internal_unpack_r8): Regenerated. + * generated/reshape_c10.c (reshape_c10): Regenerated. + * generated/reshape_c16.c (reshape_c16): Regenerated. + * generated/reshape_c4.c (reshape_c4): Regenerated. + * generated/reshape_c8.c (reshape_c8): Regenerated. + * generated/reshape_i16.c (reshape_16): Regenerated. + * generated/reshape_i4.c (reshape_4): Regenerated. + * generated/reshape_i8.c (reshape_8): Regenerated. + * generated/reshape_r10.c (reshape_r10): Regenerated. + * generated/reshape_r16.c (reshape_r16): Regenerated. + * generated/reshape_r4.c (reshape_r4): Regenerated. + * generated/reshape_r8.c (reshape_r8): Regenerated. + * generated/shape_i1.c (shape_1): Regenerated. + * generated/shape_i16.c (shape_16): Regenerated. + * generated/shape_i2.c (shape_2): Regenerated. + * generated/shape_i4.c (shape_4): Regenerated. + * generated/shape_i8.c (shape_8): Regenerated. + * generated/spread_c10.c (spread_scalar_c10): Regenerated. + * generated/spread_c16.c (spread_scalar_c16): Regenerated. + * generated/spread_c4.c (spread_scalar_c4): Regenerated. + * generated/spread_c8.c (spread_scalar_c8): Regenerated. + * generated/spread_i1.c (spread_scalar_i1): Regenerated. + * generated/spread_i16.c (spread_scalar_i16): Regenerated. + * generated/spread_i2.c (spread_scalar_i2): Regenerated. + * generated/spread_i4.c (spread_scalar_i4): Regenerated. + * generated/spread_i8.c (spread_scalar_i8): Regenerated. + * generated/spread_r10.c (spread_scalar_r10): Regenerated. + * generated/spread_r16.c (spread_scalar_r16): Regenerated. + * generated/spread_r4.c (spread_scalar_r4): Regenerated. + * generated/spread_r8.c (spread_scalar_r8): Regenerated. + * intrinsics/random.c (jump): Use size_t for array index in loop. + (getosrandom): Likewise. + (arandom_r4): Make n an index_type. + (arandom_r8): Likewise. + (arandom_r10): Likewise. + (arandom_r16): Likewise. + (scramble_seed): Use size_t for array index in loop. + * m4/cshift1.m4: Make i an index_type. + * m4/eoshift1.m4: Likewise. + * m4/eoshift3.m4: Likewise. + * m4/in_pack.m4: Make n an index_type. + * m4/in_unpack.m4: Likewise. + * m4/reshape.m4: Make n and dim index_type's. + * m4/shape.m4: Make n an index_type. + * m4/spread.m4: Likewise, use index_type argument rather than + copying to int. + * runtime/bounds.c (bounds_ifunction_return): Make n an + index_type. + * runtime/in_pack_generic.c (internal_pack): Likewise. + * runtime/in_unpack_generic.c (internal_unpack): Make n and size + index_type's. + 2018-01-30 Thomas Koenig PR fortran/37577 diff --git a/libgfortran/generated/cshift1_16.c b/libgfortran/generated/cshift1_16.c index 44746b37e63..6ebca1a7650 100644 --- a/libgfortran/generated/cshift1_16.c +++ b/libgfortran/generated/cshift1_16.c @@ -77,12 +77,10 @@ cshift1 (gfc_array_char * const restrict ret, if (ret->base_addr == NULL) { - int i; - ret->base_addr = xmallocarray (arraysize, size); ret->offset = 0; GFC_DTYPE_COPY(ret,array); - for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) + for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) { index_type ub, str; diff --git a/libgfortran/generated/cshift1_4.c b/libgfortran/generated/cshift1_4.c index 4bb1c60b648..f28875f4ddd 100644 --- a/libgfortran/generated/cshift1_4.c +++ b/libgfortran/generated/cshift1_4.c @@ -77,12 +77,10 @@ cshift1 (gfc_array_char * const restrict ret, if (ret->base_addr == NULL) { - int i; - ret->base_addr = xmallocarray (arraysize, size); ret->offset = 0; GFC_DTYPE_COPY(ret,array); - for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) + for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) { index_type ub, str; diff --git a/libgfortran/generated/cshift1_8.c b/libgfortran/generated/cshift1_8.c index 1686e82aa3a..3914dc637e8 100644 --- a/libgfortran/generated/cshift1_8.c +++ b/libgfortran/generated/cshift1_8.c @@ -77,12 +77,10 @@ cshift1 (gfc_array_char * const restrict ret, if (ret->base_addr == NULL) { - int i; - ret->base_addr = xmallocarray (arraysize, size); ret->offset = 0; GFC_DTYPE_COPY(ret,array); - for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) + for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) { index_type ub, str; diff --git a/libgfortran/generated/eoshift1_16.c b/libgfortran/generated/eoshift1_16.c index 35620d64859..39c06e49eef 100644 --- a/libgfortran/generated/eoshift1_16.c +++ b/libgfortran/generated/eoshift1_16.c @@ -84,11 +84,9 @@ eoshift1 (gfc_array_char * const restrict ret, arraysize = size0 ((array_t *) array); if (ret->base_addr == NULL) { - int i; - ret->offset = 0; GFC_DTYPE_COPY(ret,array); - for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) + for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) { index_type ub, str; diff --git a/libgfortran/generated/eoshift1_4.c b/libgfortran/generated/eoshift1_4.c index 2e6c014b01e..6848c50d88c 100644 --- a/libgfortran/generated/eoshift1_4.c +++ b/libgfortran/generated/eoshift1_4.c @@ -84,11 +84,9 @@ eoshift1 (gfc_array_char * const restrict ret, arraysize = size0 ((array_t *) array); if (ret->base_addr == NULL) { - int i; - ret->offset = 0; GFC_DTYPE_COPY(ret,array); - for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) + for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) { index_type ub, str; diff --git a/libgfortran/generated/eoshift1_8.c b/libgfortran/generated/eoshift1_8.c index 4cd90a50bc0..7444db763fe 100644 --- a/libgfortran/generated/eoshift1_8.c +++ b/libgfortran/generated/eoshift1_8.c @@ -84,11 +84,9 @@ eoshift1 (gfc_array_char * const restrict ret, arraysize = size0 ((array_t *) array); if (ret->base_addr == NULL) { - int i; - ret->offset = 0; GFC_DTYPE_COPY(ret,array); - for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) + for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) { index_type ub, str; diff --git a/libgfortran/generated/eoshift3_16.c b/libgfortran/generated/eoshift3_16.c index 018b640970f..cf4a8d062fa 100644 --- a/libgfortran/generated/eoshift3_16.c +++ b/libgfortran/generated/eoshift3_16.c @@ -85,12 +85,10 @@ eoshift3 (gfc_array_char * const restrict ret, if (ret->base_addr == NULL) { - int i; - ret->base_addr = xmallocarray (arraysize, size); ret->offset = 0; GFC_DTYPE_COPY(ret,array); - for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) + for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) { index_type ub, str; diff --git a/libgfortran/generated/eoshift3_4.c b/libgfortran/generated/eoshift3_4.c index c27dcbad764..f47577a67a2 100644 --- a/libgfortran/generated/eoshift3_4.c +++ b/libgfortran/generated/eoshift3_4.c @@ -85,12 +85,10 @@ eoshift3 (gfc_array_char * const restrict ret, if (ret->base_addr == NULL) { - int i; - ret->base_addr = xmallocarray (arraysize, size); ret->offset = 0; GFC_DTYPE_COPY(ret,array); - for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) + for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) { index_type ub, str; diff --git a/libgfortran/generated/eoshift3_8.c b/libgfortran/generated/eoshift3_8.c index 2649ced788c..b2814db72ce 100644 --- a/libgfortran/generated/eoshift3_8.c +++ b/libgfortran/generated/eoshift3_8.c @@ -85,12 +85,10 @@ eoshift3 (gfc_array_char * const restrict ret, if (ret->base_addr == NULL) { - int i; - ret->base_addr = xmallocarray (arraysize, size); ret->offset = 0; GFC_DTYPE_COPY(ret,array); - for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) + for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) { index_type ub, str; diff --git a/libgfortran/generated/in_pack_c10.c b/libgfortran/generated/in_pack_c10.c index a30be341912..9c2ee4fc447 100644 --- a/libgfortran/generated/in_pack_c10.c +++ b/libgfortran/generated/in_pack_c10.c @@ -43,7 +43,6 @@ internal_pack_c10 (gfc_array_c10 * source) const GFC_COMPLEX_10 *src; GFC_COMPLEX_10 * restrict dest; GFC_COMPLEX_10 *destptr; - int n; int packed; /* TODO: Investigate how we can figure out if this is a temporary @@ -52,7 +51,7 @@ internal_pack_c10 (gfc_array_c10 * source) dim = GFC_DESCRIPTOR_RANK (source); ssize = 1; packed = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -88,7 +87,7 @@ internal_pack_c10 (gfc_array_c10 * source) src += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_pack_c16.c b/libgfortran/generated/in_pack_c16.c index 1562d975cd0..9aab669fd11 100644 --- a/libgfortran/generated/in_pack_c16.c +++ b/libgfortran/generated/in_pack_c16.c @@ -43,7 +43,6 @@ internal_pack_c16 (gfc_array_c16 * source) const GFC_COMPLEX_16 *src; GFC_COMPLEX_16 * restrict dest; GFC_COMPLEX_16 *destptr; - int n; int packed; /* TODO: Investigate how we can figure out if this is a temporary @@ -52,7 +51,7 @@ internal_pack_c16 (gfc_array_c16 * source) dim = GFC_DESCRIPTOR_RANK (source); ssize = 1; packed = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -88,7 +87,7 @@ internal_pack_c16 (gfc_array_c16 * source) src += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_pack_c4.c b/libgfortran/generated/in_pack_c4.c index 41409542d49..55fdd76a5d5 100644 --- a/libgfortran/generated/in_pack_c4.c +++ b/libgfortran/generated/in_pack_c4.c @@ -43,7 +43,6 @@ internal_pack_c4 (gfc_array_c4 * source) const GFC_COMPLEX_4 *src; GFC_COMPLEX_4 * restrict dest; GFC_COMPLEX_4 *destptr; - int n; int packed; /* TODO: Investigate how we can figure out if this is a temporary @@ -52,7 +51,7 @@ internal_pack_c4 (gfc_array_c4 * source) dim = GFC_DESCRIPTOR_RANK (source); ssize = 1; packed = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -88,7 +87,7 @@ internal_pack_c4 (gfc_array_c4 * source) src += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_pack_c8.c b/libgfortran/generated/in_pack_c8.c index 6526644a298..c8d873232fd 100644 --- a/libgfortran/generated/in_pack_c8.c +++ b/libgfortran/generated/in_pack_c8.c @@ -43,7 +43,6 @@ internal_pack_c8 (gfc_array_c8 * source) const GFC_COMPLEX_8 *src; GFC_COMPLEX_8 * restrict dest; GFC_COMPLEX_8 *destptr; - int n; int packed; /* TODO: Investigate how we can figure out if this is a temporary @@ -52,7 +51,7 @@ internal_pack_c8 (gfc_array_c8 * source) dim = GFC_DESCRIPTOR_RANK (source); ssize = 1; packed = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -88,7 +87,7 @@ internal_pack_c8 (gfc_array_c8 * source) src += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_pack_i1.c b/libgfortran/generated/in_pack_i1.c index 1f2d389f010..83cdeadeb12 100644 --- a/libgfortran/generated/in_pack_i1.c +++ b/libgfortran/generated/in_pack_i1.c @@ -43,7 +43,6 @@ internal_pack_1 (gfc_array_i1 * source) const GFC_INTEGER_1 *src; GFC_INTEGER_1 * restrict dest; GFC_INTEGER_1 *destptr; - int n; int packed; /* TODO: Investigate how we can figure out if this is a temporary @@ -52,7 +51,7 @@ internal_pack_1 (gfc_array_i1 * source) dim = GFC_DESCRIPTOR_RANK (source); ssize = 1; packed = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -88,7 +87,7 @@ internal_pack_1 (gfc_array_i1 * source) src += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_pack_i16.c b/libgfortran/generated/in_pack_i16.c index 36735ed3539..746f5c441ac 100644 --- a/libgfortran/generated/in_pack_i16.c +++ b/libgfortran/generated/in_pack_i16.c @@ -43,7 +43,6 @@ internal_pack_16 (gfc_array_i16 * source) const GFC_INTEGER_16 *src; GFC_INTEGER_16 * restrict dest; GFC_INTEGER_16 *destptr; - int n; int packed; /* TODO: Investigate how we can figure out if this is a temporary @@ -52,7 +51,7 @@ internal_pack_16 (gfc_array_i16 * source) dim = GFC_DESCRIPTOR_RANK (source); ssize = 1; packed = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -88,7 +87,7 @@ internal_pack_16 (gfc_array_i16 * source) src += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_pack_i2.c b/libgfortran/generated/in_pack_i2.c index c0aac72aa00..47f66115690 100644 --- a/libgfortran/generated/in_pack_i2.c +++ b/libgfortran/generated/in_pack_i2.c @@ -43,7 +43,6 @@ internal_pack_2 (gfc_array_i2 * source) const GFC_INTEGER_2 *src; GFC_INTEGER_2 * restrict dest; GFC_INTEGER_2 *destptr; - int n; int packed; /* TODO: Investigate how we can figure out if this is a temporary @@ -52,7 +51,7 @@ internal_pack_2 (gfc_array_i2 * source) dim = GFC_DESCRIPTOR_RANK (source); ssize = 1; packed = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -88,7 +87,7 @@ internal_pack_2 (gfc_array_i2 * source) src += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_pack_i4.c b/libgfortran/generated/in_pack_i4.c index 12fc6e39097..dea118b54a9 100644 --- a/libgfortran/generated/in_pack_i4.c +++ b/libgfortran/generated/in_pack_i4.c @@ -43,7 +43,6 @@ internal_pack_4 (gfc_array_i4 * source) const GFC_INTEGER_4 *src; GFC_INTEGER_4 * restrict dest; GFC_INTEGER_4 *destptr; - int n; int packed; /* TODO: Investigate how we can figure out if this is a temporary @@ -52,7 +51,7 @@ internal_pack_4 (gfc_array_i4 * source) dim = GFC_DESCRIPTOR_RANK (source); ssize = 1; packed = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -88,7 +87,7 @@ internal_pack_4 (gfc_array_i4 * source) src += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_pack_i8.c b/libgfortran/generated/in_pack_i8.c index 694e5eed9df..086614b1561 100644 --- a/libgfortran/generated/in_pack_i8.c +++ b/libgfortran/generated/in_pack_i8.c @@ -43,7 +43,6 @@ internal_pack_8 (gfc_array_i8 * source) const GFC_INTEGER_8 *src; GFC_INTEGER_8 * restrict dest; GFC_INTEGER_8 *destptr; - int n; int packed; /* TODO: Investigate how we can figure out if this is a temporary @@ -52,7 +51,7 @@ internal_pack_8 (gfc_array_i8 * source) dim = GFC_DESCRIPTOR_RANK (source); ssize = 1; packed = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -88,7 +87,7 @@ internal_pack_8 (gfc_array_i8 * source) src += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_pack_r10.c b/libgfortran/generated/in_pack_r10.c index f3c8e7b1e0f..47fcc3a2c7d 100644 --- a/libgfortran/generated/in_pack_r10.c +++ b/libgfortran/generated/in_pack_r10.c @@ -43,7 +43,6 @@ internal_pack_r10 (gfc_array_r10 * source) const GFC_REAL_10 *src; GFC_REAL_10 * restrict dest; GFC_REAL_10 *destptr; - int n; int packed; /* TODO: Investigate how we can figure out if this is a temporary @@ -52,7 +51,7 @@ internal_pack_r10 (gfc_array_r10 * source) dim = GFC_DESCRIPTOR_RANK (source); ssize = 1; packed = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -88,7 +87,7 @@ internal_pack_r10 (gfc_array_r10 * source) src += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_pack_r16.c b/libgfortran/generated/in_pack_r16.c index 9405dec36cb..6d51cb47770 100644 --- a/libgfortran/generated/in_pack_r16.c +++ b/libgfortran/generated/in_pack_r16.c @@ -43,7 +43,6 @@ internal_pack_r16 (gfc_array_r16 * source) const GFC_REAL_16 *src; GFC_REAL_16 * restrict dest; GFC_REAL_16 *destptr; - int n; int packed; /* TODO: Investigate how we can figure out if this is a temporary @@ -52,7 +51,7 @@ internal_pack_r16 (gfc_array_r16 * source) dim = GFC_DESCRIPTOR_RANK (source); ssize = 1; packed = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -88,7 +87,7 @@ internal_pack_r16 (gfc_array_r16 * source) src += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_pack_r4.c b/libgfortran/generated/in_pack_r4.c index 95633f57925..6bc1f0f05b7 100644 --- a/libgfortran/generated/in_pack_r4.c +++ b/libgfortran/generated/in_pack_r4.c @@ -43,7 +43,6 @@ internal_pack_r4 (gfc_array_r4 * source) const GFC_REAL_4 *src; GFC_REAL_4 * restrict dest; GFC_REAL_4 *destptr; - int n; int packed; /* TODO: Investigate how we can figure out if this is a temporary @@ -52,7 +51,7 @@ internal_pack_r4 (gfc_array_r4 * source) dim = GFC_DESCRIPTOR_RANK (source); ssize = 1; packed = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -88,7 +87,7 @@ internal_pack_r4 (gfc_array_r4 * source) src += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_pack_r8.c b/libgfortran/generated/in_pack_r8.c index c13ad88b005..bf9acb181a7 100644 --- a/libgfortran/generated/in_pack_r8.c +++ b/libgfortran/generated/in_pack_r8.c @@ -43,7 +43,6 @@ internal_pack_r8 (gfc_array_r8 * source) const GFC_REAL_8 *src; GFC_REAL_8 * restrict dest; GFC_REAL_8 *destptr; - int n; int packed; /* TODO: Investigate how we can figure out if this is a temporary @@ -52,7 +51,7 @@ internal_pack_r8 (gfc_array_r8 * source) dim = GFC_DESCRIPTOR_RANK (source); ssize = 1; packed = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -88,7 +87,7 @@ internal_pack_r8 (gfc_array_r8 * source) src += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_unpack_c10.c b/libgfortran/generated/in_unpack_c10.c index 4dfbcb4ff71..b85529c1a77 100644 --- a/libgfortran/generated/in_unpack_c10.c +++ b/libgfortran/generated/in_unpack_c10.c @@ -39,7 +39,6 @@ internal_unpack_c10 (gfc_array_c10 * d, const GFC_COMPLEX_10 * src) index_type dim; index_type dsize; GFC_COMPLEX_10 * restrict dest; - int n; dest = d->base_addr; if (src == dest || !src) @@ -47,7 +46,7 @@ internal_unpack_c10 (gfc_array_c10 * d, const GFC_COMPLEX_10 * src) dim = GFC_DESCRIPTOR_RANK (d); dsize = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(d,n); @@ -77,7 +76,7 @@ internal_unpack_c10 (gfc_array_c10 * d, const GFC_COMPLEX_10 * src) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_unpack_c16.c b/libgfortran/generated/in_unpack_c16.c index e007ef6b8ef..16fd0322c58 100644 --- a/libgfortran/generated/in_unpack_c16.c +++ b/libgfortran/generated/in_unpack_c16.c @@ -39,7 +39,6 @@ internal_unpack_c16 (gfc_array_c16 * d, const GFC_COMPLEX_16 * src) index_type dim; index_type dsize; GFC_COMPLEX_16 * restrict dest; - int n; dest = d->base_addr; if (src == dest || !src) @@ -47,7 +46,7 @@ internal_unpack_c16 (gfc_array_c16 * d, const GFC_COMPLEX_16 * src) dim = GFC_DESCRIPTOR_RANK (d); dsize = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(d,n); @@ -77,7 +76,7 @@ internal_unpack_c16 (gfc_array_c16 * d, const GFC_COMPLEX_16 * src) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_unpack_c4.c b/libgfortran/generated/in_unpack_c4.c index c5386d53479..320dc95d2a5 100644 --- a/libgfortran/generated/in_unpack_c4.c +++ b/libgfortran/generated/in_unpack_c4.c @@ -39,7 +39,6 @@ internal_unpack_c4 (gfc_array_c4 * d, const GFC_COMPLEX_4 * src) index_type dim; index_type dsize; GFC_COMPLEX_4 * restrict dest; - int n; dest = d->base_addr; if (src == dest || !src) @@ -47,7 +46,7 @@ internal_unpack_c4 (gfc_array_c4 * d, const GFC_COMPLEX_4 * src) dim = GFC_DESCRIPTOR_RANK (d); dsize = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(d,n); @@ -77,7 +76,7 @@ internal_unpack_c4 (gfc_array_c4 * d, const GFC_COMPLEX_4 * src) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_unpack_c8.c b/libgfortran/generated/in_unpack_c8.c index 864b2ad477e..64030e07aac 100644 --- a/libgfortran/generated/in_unpack_c8.c +++ b/libgfortran/generated/in_unpack_c8.c @@ -39,7 +39,6 @@ internal_unpack_c8 (gfc_array_c8 * d, const GFC_COMPLEX_8 * src) index_type dim; index_type dsize; GFC_COMPLEX_8 * restrict dest; - int n; dest = d->base_addr; if (src == dest || !src) @@ -47,7 +46,7 @@ internal_unpack_c8 (gfc_array_c8 * d, const GFC_COMPLEX_8 * src) dim = GFC_DESCRIPTOR_RANK (d); dsize = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(d,n); @@ -77,7 +76,7 @@ internal_unpack_c8 (gfc_array_c8 * d, const GFC_COMPLEX_8 * src) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_unpack_i1.c b/libgfortran/generated/in_unpack_i1.c index ba61b4936e5..e96eb69a860 100644 --- a/libgfortran/generated/in_unpack_i1.c +++ b/libgfortran/generated/in_unpack_i1.c @@ -39,7 +39,6 @@ internal_unpack_1 (gfc_array_i1 * d, const GFC_INTEGER_1 * src) index_type dim; index_type dsize; GFC_INTEGER_1 * restrict dest; - int n; dest = d->base_addr; if (src == dest || !src) @@ -47,7 +46,7 @@ internal_unpack_1 (gfc_array_i1 * d, const GFC_INTEGER_1 * src) dim = GFC_DESCRIPTOR_RANK (d); dsize = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(d,n); @@ -77,7 +76,7 @@ internal_unpack_1 (gfc_array_i1 * d, const GFC_INTEGER_1 * src) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_unpack_i16.c b/libgfortran/generated/in_unpack_i16.c index 392e4f7fec2..54fe60ad457 100644 --- a/libgfortran/generated/in_unpack_i16.c +++ b/libgfortran/generated/in_unpack_i16.c @@ -39,7 +39,6 @@ internal_unpack_16 (gfc_array_i16 * d, const GFC_INTEGER_16 * src) index_type dim; index_type dsize; GFC_INTEGER_16 * restrict dest; - int n; dest = d->base_addr; if (src == dest || !src) @@ -47,7 +46,7 @@ internal_unpack_16 (gfc_array_i16 * d, const GFC_INTEGER_16 * src) dim = GFC_DESCRIPTOR_RANK (d); dsize = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(d,n); @@ -77,7 +76,7 @@ internal_unpack_16 (gfc_array_i16 * d, const GFC_INTEGER_16 * src) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_unpack_i2.c b/libgfortran/generated/in_unpack_i2.c index dd036e53b50..6d0195d73fc 100644 --- a/libgfortran/generated/in_unpack_i2.c +++ b/libgfortran/generated/in_unpack_i2.c @@ -39,7 +39,6 @@ internal_unpack_2 (gfc_array_i2 * d, const GFC_INTEGER_2 * src) index_type dim; index_type dsize; GFC_INTEGER_2 * restrict dest; - int n; dest = d->base_addr; if (src == dest || !src) @@ -47,7 +46,7 @@ internal_unpack_2 (gfc_array_i2 * d, const GFC_INTEGER_2 * src) dim = GFC_DESCRIPTOR_RANK (d); dsize = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(d,n); @@ -77,7 +76,7 @@ internal_unpack_2 (gfc_array_i2 * d, const GFC_INTEGER_2 * src) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_unpack_i4.c b/libgfortran/generated/in_unpack_i4.c index 928a695fda8..86102ab857c 100644 --- a/libgfortran/generated/in_unpack_i4.c +++ b/libgfortran/generated/in_unpack_i4.c @@ -39,7 +39,6 @@ internal_unpack_4 (gfc_array_i4 * d, const GFC_INTEGER_4 * src) index_type dim; index_type dsize; GFC_INTEGER_4 * restrict dest; - int n; dest = d->base_addr; if (src == dest || !src) @@ -47,7 +46,7 @@ internal_unpack_4 (gfc_array_i4 * d, const GFC_INTEGER_4 * src) dim = GFC_DESCRIPTOR_RANK (d); dsize = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(d,n); @@ -77,7 +76,7 @@ internal_unpack_4 (gfc_array_i4 * d, const GFC_INTEGER_4 * src) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_unpack_i8.c b/libgfortran/generated/in_unpack_i8.c index 21ad0c6fa1f..e51547d3104 100644 --- a/libgfortran/generated/in_unpack_i8.c +++ b/libgfortran/generated/in_unpack_i8.c @@ -39,7 +39,6 @@ internal_unpack_8 (gfc_array_i8 * d, const GFC_INTEGER_8 * src) index_type dim; index_type dsize; GFC_INTEGER_8 * restrict dest; - int n; dest = d->base_addr; if (src == dest || !src) @@ -47,7 +46,7 @@ internal_unpack_8 (gfc_array_i8 * d, const GFC_INTEGER_8 * src) dim = GFC_DESCRIPTOR_RANK (d); dsize = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(d,n); @@ -77,7 +76,7 @@ internal_unpack_8 (gfc_array_i8 * d, const GFC_INTEGER_8 * src) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_unpack_r10.c b/libgfortran/generated/in_unpack_r10.c index c937b713156..8a301be58cb 100644 --- a/libgfortran/generated/in_unpack_r10.c +++ b/libgfortran/generated/in_unpack_r10.c @@ -39,7 +39,6 @@ internal_unpack_r10 (gfc_array_r10 * d, const GFC_REAL_10 * src) index_type dim; index_type dsize; GFC_REAL_10 * restrict dest; - int n; dest = d->base_addr; if (src == dest || !src) @@ -47,7 +46,7 @@ internal_unpack_r10 (gfc_array_r10 * d, const GFC_REAL_10 * src) dim = GFC_DESCRIPTOR_RANK (d); dsize = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(d,n); @@ -77,7 +76,7 @@ internal_unpack_r10 (gfc_array_r10 * d, const GFC_REAL_10 * src) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_unpack_r16.c b/libgfortran/generated/in_unpack_r16.c index 1e83ae3d9fd..03ecae7e106 100644 --- a/libgfortran/generated/in_unpack_r16.c +++ b/libgfortran/generated/in_unpack_r16.c @@ -39,7 +39,6 @@ internal_unpack_r16 (gfc_array_r16 * d, const GFC_REAL_16 * src) index_type dim; index_type dsize; GFC_REAL_16 * restrict dest; - int n; dest = d->base_addr; if (src == dest || !src) @@ -47,7 +46,7 @@ internal_unpack_r16 (gfc_array_r16 * d, const GFC_REAL_16 * src) dim = GFC_DESCRIPTOR_RANK (d); dsize = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(d,n); @@ -77,7 +76,7 @@ internal_unpack_r16 (gfc_array_r16 * d, const GFC_REAL_16 * src) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_unpack_r4.c b/libgfortran/generated/in_unpack_r4.c index 7a26323e930..086cc6ac895 100644 --- a/libgfortran/generated/in_unpack_r4.c +++ b/libgfortran/generated/in_unpack_r4.c @@ -39,7 +39,6 @@ internal_unpack_r4 (gfc_array_r4 * d, const GFC_REAL_4 * src) index_type dim; index_type dsize; GFC_REAL_4 * restrict dest; - int n; dest = d->base_addr; if (src == dest || !src) @@ -47,7 +46,7 @@ internal_unpack_r4 (gfc_array_r4 * d, const GFC_REAL_4 * src) dim = GFC_DESCRIPTOR_RANK (d); dsize = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(d,n); @@ -77,7 +76,7 @@ internal_unpack_r4 (gfc_array_r4 * d, const GFC_REAL_4 * src) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/in_unpack_r8.c b/libgfortran/generated/in_unpack_r8.c index 8805dcc331f..d7dd5ea7f0e 100644 --- a/libgfortran/generated/in_unpack_r8.c +++ b/libgfortran/generated/in_unpack_r8.c @@ -39,7 +39,6 @@ internal_unpack_r8 (gfc_array_r8 * d, const GFC_REAL_8 * src) index_type dim; index_type dsize; GFC_REAL_8 * restrict dest; - int n; dest = d->base_addr; if (src == dest || !src) @@ -47,7 +46,7 @@ internal_unpack_r8 (gfc_array_r8 * d, const GFC_REAL_8 * src) dim = GFC_DESCRIPTOR_RANK (d); dsize = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(d,n); @@ -77,7 +76,7 @@ internal_unpack_r8 (gfc_array_r8 * d, const GFC_REAL_8 * src) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/generated/reshape_c10.c b/libgfortran/generated/reshape_c10.c index 6bf12fd6a6c..dbea98d1738 100644 --- a/libgfortran/generated/reshape_c10.c +++ b/libgfortran/generated/reshape_c10.c @@ -72,8 +72,6 @@ reshape_c10 (gfc_array_c10 * const restrict ret, const GFC_COMPLEX_10 *pptr; const GFC_COMPLEX_10 *src; - int n; - int dim; int sempty, pempty, shape_empty; index_type shape_data[GFC_MAX_DIMENSIONS]; @@ -87,7 +85,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret, shape_empty = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)]; if (shape_data[n] <= 0) @@ -102,7 +100,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret, index_type alloc_size; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rex = shape_data[n]; @@ -129,7 +127,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret, pdim = GFC_DESCRIPTOR_RANK (pad); psize = 1; pempty = 0; - for (n = 0; n < pdim; n++) + for (index_type n = 0; n < pdim; n++) { pcount[n] = 0; pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n); @@ -160,7 +158,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret, index_type ret_extent, source_extent; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rs *= shape_data[n]; ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n); @@ -173,7 +171,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret, source_extent = 1; sdim = GFC_DESCRIPTOR_RANK (source); - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { index_type se; se = GFC_DESCRIPTOR_EXTENT(source,n); @@ -190,10 +188,10 @@ reshape_c10 (gfc_array_c10 * const restrict ret, int seen[GFC_MAX_DIMENSIONS]; index_type v; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) seen[n] = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; @@ -211,8 +209,9 @@ reshape_c10 (gfc_array_c10 * const restrict ret, } rsize = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { + index_type dim; if (order) dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; else @@ -243,7 +242,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret, ssize = 1; sempty = 0; - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { scount[n] = 0; sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -283,7 +282,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret, src = pptr; sptr = pptr; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; @@ -303,7 +302,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret, scount[0]++; /* Advance to the next destination element. */ - n = 0; + index_type n = 0; while (rcount[n] == rextent[n]) { /* When we get to the end of a dimension, reset it and increment @@ -343,7 +342,7 @@ reshape_c10 (gfc_array_c10 * const restrict ret, /* Switch to the pad array. */ sptr = NULL; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; diff --git a/libgfortran/generated/reshape_c16.c b/libgfortran/generated/reshape_c16.c index 28e7eeb38c5..4cf875f1518 100644 --- a/libgfortran/generated/reshape_c16.c +++ b/libgfortran/generated/reshape_c16.c @@ -72,8 +72,6 @@ reshape_c16 (gfc_array_c16 * const restrict ret, const GFC_COMPLEX_16 *pptr; const GFC_COMPLEX_16 *src; - int n; - int dim; int sempty, pempty, shape_empty; index_type shape_data[GFC_MAX_DIMENSIONS]; @@ -87,7 +85,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret, shape_empty = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)]; if (shape_data[n] <= 0) @@ -102,7 +100,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret, index_type alloc_size; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rex = shape_data[n]; @@ -129,7 +127,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret, pdim = GFC_DESCRIPTOR_RANK (pad); psize = 1; pempty = 0; - for (n = 0; n < pdim; n++) + for (index_type n = 0; n < pdim; n++) { pcount[n] = 0; pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n); @@ -160,7 +158,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret, index_type ret_extent, source_extent; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rs *= shape_data[n]; ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n); @@ -173,7 +171,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret, source_extent = 1; sdim = GFC_DESCRIPTOR_RANK (source); - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { index_type se; se = GFC_DESCRIPTOR_EXTENT(source,n); @@ -190,10 +188,10 @@ reshape_c16 (gfc_array_c16 * const restrict ret, int seen[GFC_MAX_DIMENSIONS]; index_type v; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) seen[n] = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; @@ -211,8 +209,9 @@ reshape_c16 (gfc_array_c16 * const restrict ret, } rsize = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { + index_type dim; if (order) dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; else @@ -243,7 +242,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret, ssize = 1; sempty = 0; - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { scount[n] = 0; sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -283,7 +282,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret, src = pptr; sptr = pptr; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; @@ -303,7 +302,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret, scount[0]++; /* Advance to the next destination element. */ - n = 0; + index_type n = 0; while (rcount[n] == rextent[n]) { /* When we get to the end of a dimension, reset it and increment @@ -343,7 +342,7 @@ reshape_c16 (gfc_array_c16 * const restrict ret, /* Switch to the pad array. */ sptr = NULL; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; diff --git a/libgfortran/generated/reshape_c4.c b/libgfortran/generated/reshape_c4.c index 15997a067df..da718ad9a44 100644 --- a/libgfortran/generated/reshape_c4.c +++ b/libgfortran/generated/reshape_c4.c @@ -72,8 +72,6 @@ reshape_c4 (gfc_array_c4 * const restrict ret, const GFC_COMPLEX_4 *pptr; const GFC_COMPLEX_4 *src; - int n; - int dim; int sempty, pempty, shape_empty; index_type shape_data[GFC_MAX_DIMENSIONS]; @@ -87,7 +85,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret, shape_empty = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)]; if (shape_data[n] <= 0) @@ -102,7 +100,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret, index_type alloc_size; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rex = shape_data[n]; @@ -129,7 +127,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret, pdim = GFC_DESCRIPTOR_RANK (pad); psize = 1; pempty = 0; - for (n = 0; n < pdim; n++) + for (index_type n = 0; n < pdim; n++) { pcount[n] = 0; pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n); @@ -160,7 +158,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret, index_type ret_extent, source_extent; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rs *= shape_data[n]; ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n); @@ -173,7 +171,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret, source_extent = 1; sdim = GFC_DESCRIPTOR_RANK (source); - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { index_type se; se = GFC_DESCRIPTOR_EXTENT(source,n); @@ -190,10 +188,10 @@ reshape_c4 (gfc_array_c4 * const restrict ret, int seen[GFC_MAX_DIMENSIONS]; index_type v; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) seen[n] = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; @@ -211,8 +209,9 @@ reshape_c4 (gfc_array_c4 * const restrict ret, } rsize = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { + index_type dim; if (order) dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; else @@ -243,7 +242,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret, ssize = 1; sempty = 0; - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { scount[n] = 0; sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -283,7 +282,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret, src = pptr; sptr = pptr; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; @@ -303,7 +302,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret, scount[0]++; /* Advance to the next destination element. */ - n = 0; + index_type n = 0; while (rcount[n] == rextent[n]) { /* When we get to the end of a dimension, reset it and increment @@ -343,7 +342,7 @@ reshape_c4 (gfc_array_c4 * const restrict ret, /* Switch to the pad array. */ sptr = NULL; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; diff --git a/libgfortran/generated/reshape_c8.c b/libgfortran/generated/reshape_c8.c index be5457f252e..9fa7aca1abd 100644 --- a/libgfortran/generated/reshape_c8.c +++ b/libgfortran/generated/reshape_c8.c @@ -72,8 +72,6 @@ reshape_c8 (gfc_array_c8 * const restrict ret, const GFC_COMPLEX_8 *pptr; const GFC_COMPLEX_8 *src; - int n; - int dim; int sempty, pempty, shape_empty; index_type shape_data[GFC_MAX_DIMENSIONS]; @@ -87,7 +85,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret, shape_empty = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)]; if (shape_data[n] <= 0) @@ -102,7 +100,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret, index_type alloc_size; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rex = shape_data[n]; @@ -129,7 +127,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret, pdim = GFC_DESCRIPTOR_RANK (pad); psize = 1; pempty = 0; - for (n = 0; n < pdim; n++) + for (index_type n = 0; n < pdim; n++) { pcount[n] = 0; pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n); @@ -160,7 +158,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret, index_type ret_extent, source_extent; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rs *= shape_data[n]; ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n); @@ -173,7 +171,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret, source_extent = 1; sdim = GFC_DESCRIPTOR_RANK (source); - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { index_type se; se = GFC_DESCRIPTOR_EXTENT(source,n); @@ -190,10 +188,10 @@ reshape_c8 (gfc_array_c8 * const restrict ret, int seen[GFC_MAX_DIMENSIONS]; index_type v; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) seen[n] = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; @@ -211,8 +209,9 @@ reshape_c8 (gfc_array_c8 * const restrict ret, } rsize = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { + index_type dim; if (order) dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; else @@ -243,7 +242,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret, ssize = 1; sempty = 0; - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { scount[n] = 0; sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -283,7 +282,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret, src = pptr; sptr = pptr; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; @@ -303,7 +302,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret, scount[0]++; /* Advance to the next destination element. */ - n = 0; + index_type n = 0; while (rcount[n] == rextent[n]) { /* When we get to the end of a dimension, reset it and increment @@ -343,7 +342,7 @@ reshape_c8 (gfc_array_c8 * const restrict ret, /* Switch to the pad array. */ sptr = NULL; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; diff --git a/libgfortran/generated/reshape_i16.c b/libgfortran/generated/reshape_i16.c index 3d4d516fc4e..8d3e218cdd6 100644 --- a/libgfortran/generated/reshape_i16.c +++ b/libgfortran/generated/reshape_i16.c @@ -72,8 +72,6 @@ reshape_16 (gfc_array_i16 * const restrict ret, const GFC_INTEGER_16 *pptr; const GFC_INTEGER_16 *src; - int n; - int dim; int sempty, pempty, shape_empty; index_type shape_data[GFC_MAX_DIMENSIONS]; @@ -87,7 +85,7 @@ reshape_16 (gfc_array_i16 * const restrict ret, shape_empty = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)]; if (shape_data[n] <= 0) @@ -102,7 +100,7 @@ reshape_16 (gfc_array_i16 * const restrict ret, index_type alloc_size; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rex = shape_data[n]; @@ -129,7 +127,7 @@ reshape_16 (gfc_array_i16 * const restrict ret, pdim = GFC_DESCRIPTOR_RANK (pad); psize = 1; pempty = 0; - for (n = 0; n < pdim; n++) + for (index_type n = 0; n < pdim; n++) { pcount[n] = 0; pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n); @@ -160,7 +158,7 @@ reshape_16 (gfc_array_i16 * const restrict ret, index_type ret_extent, source_extent; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rs *= shape_data[n]; ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n); @@ -173,7 +171,7 @@ reshape_16 (gfc_array_i16 * const restrict ret, source_extent = 1; sdim = GFC_DESCRIPTOR_RANK (source); - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { index_type se; se = GFC_DESCRIPTOR_EXTENT(source,n); @@ -190,10 +188,10 @@ reshape_16 (gfc_array_i16 * const restrict ret, int seen[GFC_MAX_DIMENSIONS]; index_type v; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) seen[n] = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; @@ -211,8 +209,9 @@ reshape_16 (gfc_array_i16 * const restrict ret, } rsize = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { + index_type dim; if (order) dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; else @@ -243,7 +242,7 @@ reshape_16 (gfc_array_i16 * const restrict ret, ssize = 1; sempty = 0; - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { scount[n] = 0; sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -283,7 +282,7 @@ reshape_16 (gfc_array_i16 * const restrict ret, src = pptr; sptr = pptr; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; @@ -303,7 +302,7 @@ reshape_16 (gfc_array_i16 * const restrict ret, scount[0]++; /* Advance to the next destination element. */ - n = 0; + index_type n = 0; while (rcount[n] == rextent[n]) { /* When we get to the end of a dimension, reset it and increment @@ -343,7 +342,7 @@ reshape_16 (gfc_array_i16 * const restrict ret, /* Switch to the pad array. */ sptr = NULL; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; diff --git a/libgfortran/generated/reshape_i4.c b/libgfortran/generated/reshape_i4.c index 64fae81ff37..d5348529290 100644 --- a/libgfortran/generated/reshape_i4.c +++ b/libgfortran/generated/reshape_i4.c @@ -72,8 +72,6 @@ reshape_4 (gfc_array_i4 * const restrict ret, const GFC_INTEGER_4 *pptr; const GFC_INTEGER_4 *src; - int n; - int dim; int sempty, pempty, shape_empty; index_type shape_data[GFC_MAX_DIMENSIONS]; @@ -87,7 +85,7 @@ reshape_4 (gfc_array_i4 * const restrict ret, shape_empty = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)]; if (shape_data[n] <= 0) @@ -102,7 +100,7 @@ reshape_4 (gfc_array_i4 * const restrict ret, index_type alloc_size; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rex = shape_data[n]; @@ -129,7 +127,7 @@ reshape_4 (gfc_array_i4 * const restrict ret, pdim = GFC_DESCRIPTOR_RANK (pad); psize = 1; pempty = 0; - for (n = 0; n < pdim; n++) + for (index_type n = 0; n < pdim; n++) { pcount[n] = 0; pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n); @@ -160,7 +158,7 @@ reshape_4 (gfc_array_i4 * const restrict ret, index_type ret_extent, source_extent; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rs *= shape_data[n]; ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n); @@ -173,7 +171,7 @@ reshape_4 (gfc_array_i4 * const restrict ret, source_extent = 1; sdim = GFC_DESCRIPTOR_RANK (source); - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { index_type se; se = GFC_DESCRIPTOR_EXTENT(source,n); @@ -190,10 +188,10 @@ reshape_4 (gfc_array_i4 * const restrict ret, int seen[GFC_MAX_DIMENSIONS]; index_type v; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) seen[n] = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; @@ -211,8 +209,9 @@ reshape_4 (gfc_array_i4 * const restrict ret, } rsize = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { + index_type dim; if (order) dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; else @@ -243,7 +242,7 @@ reshape_4 (gfc_array_i4 * const restrict ret, ssize = 1; sempty = 0; - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { scount[n] = 0; sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -283,7 +282,7 @@ reshape_4 (gfc_array_i4 * const restrict ret, src = pptr; sptr = pptr; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; @@ -303,7 +302,7 @@ reshape_4 (gfc_array_i4 * const restrict ret, scount[0]++; /* Advance to the next destination element. */ - n = 0; + index_type n = 0; while (rcount[n] == rextent[n]) { /* When we get to the end of a dimension, reset it and increment @@ -343,7 +342,7 @@ reshape_4 (gfc_array_i4 * const restrict ret, /* Switch to the pad array. */ sptr = NULL; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; diff --git a/libgfortran/generated/reshape_i8.c b/libgfortran/generated/reshape_i8.c index aa675a7fd88..205d45efd25 100644 --- a/libgfortran/generated/reshape_i8.c +++ b/libgfortran/generated/reshape_i8.c @@ -72,8 +72,6 @@ reshape_8 (gfc_array_i8 * const restrict ret, const GFC_INTEGER_8 *pptr; const GFC_INTEGER_8 *src; - int n; - int dim; int sempty, pempty, shape_empty; index_type shape_data[GFC_MAX_DIMENSIONS]; @@ -87,7 +85,7 @@ reshape_8 (gfc_array_i8 * const restrict ret, shape_empty = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)]; if (shape_data[n] <= 0) @@ -102,7 +100,7 @@ reshape_8 (gfc_array_i8 * const restrict ret, index_type alloc_size; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rex = shape_data[n]; @@ -129,7 +127,7 @@ reshape_8 (gfc_array_i8 * const restrict ret, pdim = GFC_DESCRIPTOR_RANK (pad); psize = 1; pempty = 0; - for (n = 0; n < pdim; n++) + for (index_type n = 0; n < pdim; n++) { pcount[n] = 0; pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n); @@ -160,7 +158,7 @@ reshape_8 (gfc_array_i8 * const restrict ret, index_type ret_extent, source_extent; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rs *= shape_data[n]; ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n); @@ -173,7 +171,7 @@ reshape_8 (gfc_array_i8 * const restrict ret, source_extent = 1; sdim = GFC_DESCRIPTOR_RANK (source); - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { index_type se; se = GFC_DESCRIPTOR_EXTENT(source,n); @@ -190,10 +188,10 @@ reshape_8 (gfc_array_i8 * const restrict ret, int seen[GFC_MAX_DIMENSIONS]; index_type v; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) seen[n] = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; @@ -211,8 +209,9 @@ reshape_8 (gfc_array_i8 * const restrict ret, } rsize = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { + index_type dim; if (order) dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; else @@ -243,7 +242,7 @@ reshape_8 (gfc_array_i8 * const restrict ret, ssize = 1; sempty = 0; - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { scount[n] = 0; sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -283,7 +282,7 @@ reshape_8 (gfc_array_i8 * const restrict ret, src = pptr; sptr = pptr; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; @@ -303,7 +302,7 @@ reshape_8 (gfc_array_i8 * const restrict ret, scount[0]++; /* Advance to the next destination element. */ - n = 0; + index_type n = 0; while (rcount[n] == rextent[n]) { /* When we get to the end of a dimension, reset it and increment @@ -343,7 +342,7 @@ reshape_8 (gfc_array_i8 * const restrict ret, /* Switch to the pad array. */ sptr = NULL; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; diff --git a/libgfortran/generated/reshape_r10.c b/libgfortran/generated/reshape_r10.c index 2feac5adcea..15e68f1f2ba 100644 --- a/libgfortran/generated/reshape_r10.c +++ b/libgfortran/generated/reshape_r10.c @@ -72,8 +72,6 @@ reshape_r10 (gfc_array_r10 * const restrict ret, const GFC_REAL_10 *pptr; const GFC_REAL_10 *src; - int n; - int dim; int sempty, pempty, shape_empty; index_type shape_data[GFC_MAX_DIMENSIONS]; @@ -87,7 +85,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret, shape_empty = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)]; if (shape_data[n] <= 0) @@ -102,7 +100,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret, index_type alloc_size; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rex = shape_data[n]; @@ -129,7 +127,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret, pdim = GFC_DESCRIPTOR_RANK (pad); psize = 1; pempty = 0; - for (n = 0; n < pdim; n++) + for (index_type n = 0; n < pdim; n++) { pcount[n] = 0; pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n); @@ -160,7 +158,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret, index_type ret_extent, source_extent; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rs *= shape_data[n]; ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n); @@ -173,7 +171,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret, source_extent = 1; sdim = GFC_DESCRIPTOR_RANK (source); - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { index_type se; se = GFC_DESCRIPTOR_EXTENT(source,n); @@ -190,10 +188,10 @@ reshape_r10 (gfc_array_r10 * const restrict ret, int seen[GFC_MAX_DIMENSIONS]; index_type v; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) seen[n] = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; @@ -211,8 +209,9 @@ reshape_r10 (gfc_array_r10 * const restrict ret, } rsize = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { + index_type dim; if (order) dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; else @@ -243,7 +242,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret, ssize = 1; sempty = 0; - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { scount[n] = 0; sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -283,7 +282,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret, src = pptr; sptr = pptr; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; @@ -303,7 +302,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret, scount[0]++; /* Advance to the next destination element. */ - n = 0; + index_type n = 0; while (rcount[n] == rextent[n]) { /* When we get to the end of a dimension, reset it and increment @@ -343,7 +342,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret, /* Switch to the pad array. */ sptr = NULL; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; diff --git a/libgfortran/generated/reshape_r16.c b/libgfortran/generated/reshape_r16.c index bbfd2adc6f7..4e17d31fb7d 100644 --- a/libgfortran/generated/reshape_r16.c +++ b/libgfortran/generated/reshape_r16.c @@ -72,8 +72,6 @@ reshape_r16 (gfc_array_r16 * const restrict ret, const GFC_REAL_16 *pptr; const GFC_REAL_16 *src; - int n; - int dim; int sempty, pempty, shape_empty; index_type shape_data[GFC_MAX_DIMENSIONS]; @@ -87,7 +85,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret, shape_empty = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)]; if (shape_data[n] <= 0) @@ -102,7 +100,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret, index_type alloc_size; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rex = shape_data[n]; @@ -129,7 +127,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret, pdim = GFC_DESCRIPTOR_RANK (pad); psize = 1; pempty = 0; - for (n = 0; n < pdim; n++) + for (index_type n = 0; n < pdim; n++) { pcount[n] = 0; pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n); @@ -160,7 +158,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret, index_type ret_extent, source_extent; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rs *= shape_data[n]; ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n); @@ -173,7 +171,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret, source_extent = 1; sdim = GFC_DESCRIPTOR_RANK (source); - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { index_type se; se = GFC_DESCRIPTOR_EXTENT(source,n); @@ -190,10 +188,10 @@ reshape_r16 (gfc_array_r16 * const restrict ret, int seen[GFC_MAX_DIMENSIONS]; index_type v; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) seen[n] = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; @@ -211,8 +209,9 @@ reshape_r16 (gfc_array_r16 * const restrict ret, } rsize = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { + index_type dim; if (order) dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; else @@ -243,7 +242,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret, ssize = 1; sempty = 0; - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { scount[n] = 0; sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -283,7 +282,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret, src = pptr; sptr = pptr; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; @@ -303,7 +302,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret, scount[0]++; /* Advance to the next destination element. */ - n = 0; + index_type n = 0; while (rcount[n] == rextent[n]) { /* When we get to the end of a dimension, reset it and increment @@ -343,7 +342,7 @@ reshape_r16 (gfc_array_r16 * const restrict ret, /* Switch to the pad array. */ sptr = NULL; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; diff --git a/libgfortran/generated/reshape_r4.c b/libgfortran/generated/reshape_r4.c index b0f27dc1b46..7f419b113c1 100644 --- a/libgfortran/generated/reshape_r4.c +++ b/libgfortran/generated/reshape_r4.c @@ -72,8 +72,6 @@ reshape_r4 (gfc_array_r4 * const restrict ret, const GFC_REAL_4 *pptr; const GFC_REAL_4 *src; - int n; - int dim; int sempty, pempty, shape_empty; index_type shape_data[GFC_MAX_DIMENSIONS]; @@ -87,7 +85,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret, shape_empty = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)]; if (shape_data[n] <= 0) @@ -102,7 +100,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret, index_type alloc_size; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rex = shape_data[n]; @@ -129,7 +127,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret, pdim = GFC_DESCRIPTOR_RANK (pad); psize = 1; pempty = 0; - for (n = 0; n < pdim; n++) + for (index_type n = 0; n < pdim; n++) { pcount[n] = 0; pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n); @@ -160,7 +158,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret, index_type ret_extent, source_extent; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rs *= shape_data[n]; ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n); @@ -173,7 +171,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret, source_extent = 1; sdim = GFC_DESCRIPTOR_RANK (source); - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { index_type se; se = GFC_DESCRIPTOR_EXTENT(source,n); @@ -190,10 +188,10 @@ reshape_r4 (gfc_array_r4 * const restrict ret, int seen[GFC_MAX_DIMENSIONS]; index_type v; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) seen[n] = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; @@ -211,8 +209,9 @@ reshape_r4 (gfc_array_r4 * const restrict ret, } rsize = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { + index_type dim; if (order) dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; else @@ -243,7 +242,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret, ssize = 1; sempty = 0; - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { scount[n] = 0; sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -283,7 +282,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret, src = pptr; sptr = pptr; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; @@ -303,7 +302,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret, scount[0]++; /* Advance to the next destination element. */ - n = 0; + index_type n = 0; while (rcount[n] == rextent[n]) { /* When we get to the end of a dimension, reset it and increment @@ -343,7 +342,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret, /* Switch to the pad array. */ sptr = NULL; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; diff --git a/libgfortran/generated/reshape_r8.c b/libgfortran/generated/reshape_r8.c index bd0d2bcb326..0315b0b36ad 100644 --- a/libgfortran/generated/reshape_r8.c +++ b/libgfortran/generated/reshape_r8.c @@ -72,8 +72,6 @@ reshape_r8 (gfc_array_r8 * const restrict ret, const GFC_REAL_8 *pptr; const GFC_REAL_8 *src; - int n; - int dim; int sempty, pempty, shape_empty; index_type shape_data[GFC_MAX_DIMENSIONS]; @@ -87,7 +85,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret, shape_empty = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)]; if (shape_data[n] <= 0) @@ -102,7 +100,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret, index_type alloc_size; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rex = shape_data[n]; @@ -129,7 +127,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret, pdim = GFC_DESCRIPTOR_RANK (pad); psize = 1; pempty = 0; - for (n = 0; n < pdim; n++) + for (index_type n = 0; n < pdim; n++) { pcount[n] = 0; pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n); @@ -160,7 +158,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret, index_type ret_extent, source_extent; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rs *= shape_data[n]; ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n); @@ -173,7 +171,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret, source_extent = 1; sdim = GFC_DESCRIPTOR_RANK (source); - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { index_type se; se = GFC_DESCRIPTOR_EXTENT(source,n); @@ -190,10 +188,10 @@ reshape_r8 (gfc_array_r8 * const restrict ret, int seen[GFC_MAX_DIMENSIONS]; index_type v; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) seen[n] = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; @@ -211,8 +209,9 @@ reshape_r8 (gfc_array_r8 * const restrict ret, } rsize = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { + index_type dim; if (order) dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; else @@ -243,7 +242,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret, ssize = 1; sempty = 0; - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { scount[n] = 0; sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -283,7 +282,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret, src = pptr; sptr = pptr; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; @@ -303,7 +302,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret, scount[0]++; /* Advance to the next destination element. */ - n = 0; + index_type n = 0; while (rcount[n] == rextent[n]) { /* When we get to the end of a dimension, reset it and increment @@ -343,7 +342,7 @@ reshape_r8 (gfc_array_r8 * const restrict ret, /* Switch to the pad array. */ sptr = NULL; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; diff --git a/libgfortran/generated/shape_i1.c b/libgfortran/generated/shape_i1.c index c0e0e6a29b9..c50022257fb 100644 --- a/libgfortran/generated/shape_i1.c +++ b/libgfortran/generated/shape_i1.c @@ -36,12 +36,10 @@ void shape_1 (gfc_array_i1 * const restrict ret, const array_t * const restrict array) { - int n; index_type stride; index_type extent; - int rank; - rank = GFC_DESCRIPTOR_RANK (array); + int rank = GFC_DESCRIPTOR_RANK (array); if (ret->base_addr == NULL) { @@ -55,7 +53,7 @@ shape_1 (gfc_array_i1 * const restrict ret, if (GFC_DESCRIPTOR_EXTENT(ret,0) < 1) return; - for (n = 0; n < rank; n++) + for (index_type n = 0; n < rank; n++) { extent = GFC_DESCRIPTOR_EXTENT(array,n); ret->base_addr[n * stride] = extent > 0 ? extent : 0 ; diff --git a/libgfortran/generated/shape_i16.c b/libgfortran/generated/shape_i16.c index 89abddfcd1a..5b1498f62fb 100644 --- a/libgfortran/generated/shape_i16.c +++ b/libgfortran/generated/shape_i16.c @@ -36,12 +36,10 @@ void shape_16 (gfc_array_i16 * const restrict ret, const array_t * const restrict array) { - int n; index_type stride; index_type extent; - int rank; - rank = GFC_DESCRIPTOR_RANK (array); + int rank = GFC_DESCRIPTOR_RANK (array); if (ret->base_addr == NULL) { @@ -55,7 +53,7 @@ shape_16 (gfc_array_i16 * const restrict ret, if (GFC_DESCRIPTOR_EXTENT(ret,0) < 1) return; - for (n = 0; n < rank; n++) + for (index_type n = 0; n < rank; n++) { extent = GFC_DESCRIPTOR_EXTENT(array,n); ret->base_addr[n * stride] = extent > 0 ? extent : 0 ; diff --git a/libgfortran/generated/shape_i2.c b/libgfortran/generated/shape_i2.c index 15ee5db7dd4..d9536c7726e 100644 --- a/libgfortran/generated/shape_i2.c +++ b/libgfortran/generated/shape_i2.c @@ -36,12 +36,10 @@ void shape_2 (gfc_array_i2 * const restrict ret, const array_t * const restrict array) { - int n; index_type stride; index_type extent; - int rank; - rank = GFC_DESCRIPTOR_RANK (array); + int rank = GFC_DESCRIPTOR_RANK (array); if (ret->base_addr == NULL) { @@ -55,7 +53,7 @@ shape_2 (gfc_array_i2 * const restrict ret, if (GFC_DESCRIPTOR_EXTENT(ret,0) < 1) return; - for (n = 0; n < rank; n++) + for (index_type n = 0; n < rank; n++) { extent = GFC_DESCRIPTOR_EXTENT(array,n); ret->base_addr[n * stride] = extent > 0 ? extent : 0 ; diff --git a/libgfortran/generated/shape_i4.c b/libgfortran/generated/shape_i4.c index e05431892d9..798d0fe2f59 100644 --- a/libgfortran/generated/shape_i4.c +++ b/libgfortran/generated/shape_i4.c @@ -36,12 +36,10 @@ void shape_4 (gfc_array_i4 * const restrict ret, const array_t * const restrict array) { - int n; index_type stride; index_type extent; - int rank; - rank = GFC_DESCRIPTOR_RANK (array); + int rank = GFC_DESCRIPTOR_RANK (array); if (ret->base_addr == NULL) { @@ -55,7 +53,7 @@ shape_4 (gfc_array_i4 * const restrict ret, if (GFC_DESCRIPTOR_EXTENT(ret,0) < 1) return; - for (n = 0; n < rank; n++) + for (index_type n = 0; n < rank; n++) { extent = GFC_DESCRIPTOR_EXTENT(array,n); ret->base_addr[n * stride] = extent > 0 ? extent : 0 ; diff --git a/libgfortran/generated/shape_i8.c b/libgfortran/generated/shape_i8.c index a491fedf616..d885d8232f4 100644 --- a/libgfortran/generated/shape_i8.c +++ b/libgfortran/generated/shape_i8.c @@ -36,12 +36,10 @@ void shape_8 (gfc_array_i8 * const restrict ret, const array_t * const restrict array) { - int n; index_type stride; index_type extent; - int rank; - rank = GFC_DESCRIPTOR_RANK (array); + int rank = GFC_DESCRIPTOR_RANK (array); if (ret->base_addr == NULL) { @@ -55,7 +53,7 @@ shape_8 (gfc_array_i8 * const restrict ret, if (GFC_DESCRIPTOR_EXTENT(ret,0) < 1) return; - for (n = 0; n < rank; n++) + for (index_type n = 0; n < rank; n++) { extent = GFC_DESCRIPTOR_EXTENT(array,n); ret->base_addr[n * stride] = extent > 0 ? extent : 0 ; diff --git a/libgfortran/generated/spread_c10.c b/libgfortran/generated/spread_c10.c index 70aa950ab66..fdde4c4f8d9 100644 --- a/libgfortran/generated/spread_c10.c +++ b/libgfortran/generated/spread_c10.c @@ -227,10 +227,8 @@ spread_c10 (gfc_array_c10 *ret, const gfc_array_c10 *source, void spread_scalar_c10 (gfc_array_c10 *ret, const GFC_COMPLEX_10 *source, - const index_type along, const index_type pncopies) + const index_type along, const index_type ncopies) { - int n; - int ncopies = pncopies; GFC_COMPLEX_10 * restrict dest; index_type stride; @@ -256,7 +254,7 @@ spread_scalar_c10 (gfc_array_c10 *ret, const GFC_COMPLEX_10 *source, dest = ret->base_addr; stride = GFC_DESCRIPTOR_STRIDE(ret,0); - for (n = 0; n < ncopies; n++) + for (index_type n = 0; n < ncopies; n++) { *dest = *source; dest += stride; diff --git a/libgfortran/generated/spread_c16.c b/libgfortran/generated/spread_c16.c index 9a284a1d840..a6cb709e388 100644 --- a/libgfortran/generated/spread_c16.c +++ b/libgfortran/generated/spread_c16.c @@ -227,10 +227,8 @@ spread_c16 (gfc_array_c16 *ret, const gfc_array_c16 *source, void spread_scalar_c16 (gfc_array_c16 *ret, const GFC_COMPLEX_16 *source, - const index_type along, const index_type pncopies) + const index_type along, const index_type ncopies) { - int n; - int ncopies = pncopies; GFC_COMPLEX_16 * restrict dest; index_type stride; @@ -256,7 +254,7 @@ spread_scalar_c16 (gfc_array_c16 *ret, const GFC_COMPLEX_16 *source, dest = ret->base_addr; stride = GFC_DESCRIPTOR_STRIDE(ret,0); - for (n = 0; n < ncopies; n++) + for (index_type n = 0; n < ncopies; n++) { *dest = *source; dest += stride; diff --git a/libgfortran/generated/spread_c4.c b/libgfortran/generated/spread_c4.c index dbb12d57ac9..b9b75f188ed 100644 --- a/libgfortran/generated/spread_c4.c +++ b/libgfortran/generated/spread_c4.c @@ -227,10 +227,8 @@ spread_c4 (gfc_array_c4 *ret, const gfc_array_c4 *source, void spread_scalar_c4 (gfc_array_c4 *ret, const GFC_COMPLEX_4 *source, - const index_type along, const index_type pncopies) + const index_type along, const index_type ncopies) { - int n; - int ncopies = pncopies; GFC_COMPLEX_4 * restrict dest; index_type stride; @@ -256,7 +254,7 @@ spread_scalar_c4 (gfc_array_c4 *ret, const GFC_COMPLEX_4 *source, dest = ret->base_addr; stride = GFC_DESCRIPTOR_STRIDE(ret,0); - for (n = 0; n < ncopies; n++) + for (index_type n = 0; n < ncopies; n++) { *dest = *source; dest += stride; diff --git a/libgfortran/generated/spread_c8.c b/libgfortran/generated/spread_c8.c index 09f371fe63f..2d1dbca2478 100644 --- a/libgfortran/generated/spread_c8.c +++ b/libgfortran/generated/spread_c8.c @@ -227,10 +227,8 @@ spread_c8 (gfc_array_c8 *ret, const gfc_array_c8 *source, void spread_scalar_c8 (gfc_array_c8 *ret, const GFC_COMPLEX_8 *source, - const index_type along, const index_type pncopies) + const index_type along, const index_type ncopies) { - int n; - int ncopies = pncopies; GFC_COMPLEX_8 * restrict dest; index_type stride; @@ -256,7 +254,7 @@ spread_scalar_c8 (gfc_array_c8 *ret, const GFC_COMPLEX_8 *source, dest = ret->base_addr; stride = GFC_DESCRIPTOR_STRIDE(ret,0); - for (n = 0; n < ncopies; n++) + for (index_type n = 0; n < ncopies; n++) { *dest = *source; dest += stride; diff --git a/libgfortran/generated/spread_i1.c b/libgfortran/generated/spread_i1.c index 6c56bfcbb60..f06fd50e8dc 100644 --- a/libgfortran/generated/spread_i1.c +++ b/libgfortran/generated/spread_i1.c @@ -227,10 +227,8 @@ spread_i1 (gfc_array_i1 *ret, const gfc_array_i1 *source, void spread_scalar_i1 (gfc_array_i1 *ret, const GFC_INTEGER_1 *source, - const index_type along, const index_type pncopies) + const index_type along, const index_type ncopies) { - int n; - int ncopies = pncopies; GFC_INTEGER_1 * restrict dest; index_type stride; @@ -256,7 +254,7 @@ spread_scalar_i1 (gfc_array_i1 *ret, const GFC_INTEGER_1 *source, dest = ret->base_addr; stride = GFC_DESCRIPTOR_STRIDE(ret,0); - for (n = 0; n < ncopies; n++) + for (index_type n = 0; n < ncopies; n++) { *dest = *source; dest += stride; diff --git a/libgfortran/generated/spread_i16.c b/libgfortran/generated/spread_i16.c index a00ed752aa8..19f15d712ee 100644 --- a/libgfortran/generated/spread_i16.c +++ b/libgfortran/generated/spread_i16.c @@ -227,10 +227,8 @@ spread_i16 (gfc_array_i16 *ret, const gfc_array_i16 *source, void spread_scalar_i16 (gfc_array_i16 *ret, const GFC_INTEGER_16 *source, - const index_type along, const index_type pncopies) + const index_type along, const index_type ncopies) { - int n; - int ncopies = pncopies; GFC_INTEGER_16 * restrict dest; index_type stride; @@ -256,7 +254,7 @@ spread_scalar_i16 (gfc_array_i16 *ret, const GFC_INTEGER_16 *source, dest = ret->base_addr; stride = GFC_DESCRIPTOR_STRIDE(ret,0); - for (n = 0; n < ncopies; n++) + for (index_type n = 0; n < ncopies; n++) { *dest = *source; dest += stride; diff --git a/libgfortran/generated/spread_i2.c b/libgfortran/generated/spread_i2.c index f48d66e3713..eeb28999573 100644 --- a/libgfortran/generated/spread_i2.c +++ b/libgfortran/generated/spread_i2.c @@ -227,10 +227,8 @@ spread_i2 (gfc_array_i2 *ret, const gfc_array_i2 *source, void spread_scalar_i2 (gfc_array_i2 *ret, const GFC_INTEGER_2 *source, - const index_type along, const index_type pncopies) + const index_type along, const index_type ncopies) { - int n; - int ncopies = pncopies; GFC_INTEGER_2 * restrict dest; index_type stride; @@ -256,7 +254,7 @@ spread_scalar_i2 (gfc_array_i2 *ret, const GFC_INTEGER_2 *source, dest = ret->base_addr; stride = GFC_DESCRIPTOR_STRIDE(ret,0); - for (n = 0; n < ncopies; n++) + for (index_type n = 0; n < ncopies; n++) { *dest = *source; dest += stride; diff --git a/libgfortran/generated/spread_i4.c b/libgfortran/generated/spread_i4.c index 5703cd63be8..463e153ed73 100644 --- a/libgfortran/generated/spread_i4.c +++ b/libgfortran/generated/spread_i4.c @@ -227,10 +227,8 @@ spread_i4 (gfc_array_i4 *ret, const gfc_array_i4 *source, void spread_scalar_i4 (gfc_array_i4 *ret, const GFC_INTEGER_4 *source, - const index_type along, const index_type pncopies) + const index_type along, const index_type ncopies) { - int n; - int ncopies = pncopies; GFC_INTEGER_4 * restrict dest; index_type stride; @@ -256,7 +254,7 @@ spread_scalar_i4 (gfc_array_i4 *ret, const GFC_INTEGER_4 *source, dest = ret->base_addr; stride = GFC_DESCRIPTOR_STRIDE(ret,0); - for (n = 0; n < ncopies; n++) + for (index_type n = 0; n < ncopies; n++) { *dest = *source; dest += stride; diff --git a/libgfortran/generated/spread_i8.c b/libgfortran/generated/spread_i8.c index 25465a1620b..fe416818b07 100644 --- a/libgfortran/generated/spread_i8.c +++ b/libgfortran/generated/spread_i8.c @@ -227,10 +227,8 @@ spread_i8 (gfc_array_i8 *ret, const gfc_array_i8 *source, void spread_scalar_i8 (gfc_array_i8 *ret, const GFC_INTEGER_8 *source, - const index_type along, const index_type pncopies) + const index_type along, const index_type ncopies) { - int n; - int ncopies = pncopies; GFC_INTEGER_8 * restrict dest; index_type stride; @@ -256,7 +254,7 @@ spread_scalar_i8 (gfc_array_i8 *ret, const GFC_INTEGER_8 *source, dest = ret->base_addr; stride = GFC_DESCRIPTOR_STRIDE(ret,0); - for (n = 0; n < ncopies; n++) + for (index_type n = 0; n < ncopies; n++) { *dest = *source; dest += stride; diff --git a/libgfortran/generated/spread_r10.c b/libgfortran/generated/spread_r10.c index 5f9b021880e..4aec65d4333 100644 --- a/libgfortran/generated/spread_r10.c +++ b/libgfortran/generated/spread_r10.c @@ -227,10 +227,8 @@ spread_r10 (gfc_array_r10 *ret, const gfc_array_r10 *source, void spread_scalar_r10 (gfc_array_r10 *ret, const GFC_REAL_10 *source, - const index_type along, const index_type pncopies) + const index_type along, const index_type ncopies) { - int n; - int ncopies = pncopies; GFC_REAL_10 * restrict dest; index_type stride; @@ -256,7 +254,7 @@ spread_scalar_r10 (gfc_array_r10 *ret, const GFC_REAL_10 *source, dest = ret->base_addr; stride = GFC_DESCRIPTOR_STRIDE(ret,0); - for (n = 0; n < ncopies; n++) + for (index_type n = 0; n < ncopies; n++) { *dest = *source; dest += stride; diff --git a/libgfortran/generated/spread_r16.c b/libgfortran/generated/spread_r16.c index df0007fcd9e..8e1e9c7925e 100644 --- a/libgfortran/generated/spread_r16.c +++ b/libgfortran/generated/spread_r16.c @@ -227,10 +227,8 @@ spread_r16 (gfc_array_r16 *ret, const gfc_array_r16 *source, void spread_scalar_r16 (gfc_array_r16 *ret, const GFC_REAL_16 *source, - const index_type along, const index_type pncopies) + const index_type along, const index_type ncopies) { - int n; - int ncopies = pncopies; GFC_REAL_16 * restrict dest; index_type stride; @@ -256,7 +254,7 @@ spread_scalar_r16 (gfc_array_r16 *ret, const GFC_REAL_16 *source, dest = ret->base_addr; stride = GFC_DESCRIPTOR_STRIDE(ret,0); - for (n = 0; n < ncopies; n++) + for (index_type n = 0; n < ncopies; n++) { *dest = *source; dest += stride; diff --git a/libgfortran/generated/spread_r4.c b/libgfortran/generated/spread_r4.c index e64bf71498a..431452f51a3 100644 --- a/libgfortran/generated/spread_r4.c +++ b/libgfortran/generated/spread_r4.c @@ -227,10 +227,8 @@ spread_r4 (gfc_array_r4 *ret, const gfc_array_r4 *source, void spread_scalar_r4 (gfc_array_r4 *ret, const GFC_REAL_4 *source, - const index_type along, const index_type pncopies) + const index_type along, const index_type ncopies) { - int n; - int ncopies = pncopies; GFC_REAL_4 * restrict dest; index_type stride; @@ -256,7 +254,7 @@ spread_scalar_r4 (gfc_array_r4 *ret, const GFC_REAL_4 *source, dest = ret->base_addr; stride = GFC_DESCRIPTOR_STRIDE(ret,0); - for (n = 0; n < ncopies; n++) + for (index_type n = 0; n < ncopies; n++) { *dest = *source; dest += stride; diff --git a/libgfortran/generated/spread_r8.c b/libgfortran/generated/spread_r8.c index ca5b2f27b35..d89c8d29660 100644 --- a/libgfortran/generated/spread_r8.c +++ b/libgfortran/generated/spread_r8.c @@ -227,10 +227,8 @@ spread_r8 (gfc_array_r8 *ret, const gfc_array_r8 *source, void spread_scalar_r8 (gfc_array_r8 *ret, const GFC_REAL_8 *source, - const index_type along, const index_type pncopies) + const index_type along, const index_type ncopies) { - int n; - int ncopies = pncopies; GFC_REAL_8 * restrict dest; index_type stride; @@ -256,7 +254,7 @@ spread_scalar_r8 (gfc_array_r8 *ret, const GFC_REAL_8 *source, dest = ret->base_addr; stride = GFC_DESCRIPTOR_STRIDE(ret,0); - for (n = 0; n < ncopies; n++) + for (index_type n = 0; n < ncopies; n++) { *dest = *source; dest += stride; diff --git a/libgfortran/intrinsics/random.c b/libgfortran/intrinsics/random.c index 797f91422c4..234c5ff95fd 100644 --- a/libgfortran/intrinsics/random.c +++ b/libgfortran/intrinsics/random.c @@ -259,7 +259,7 @@ jump (xorshift1024star_state* rs) }; uint64_t t[16] = { 0 }; - for(unsigned int i = 0; i < sizeof JUMP / sizeof *JUMP; i++) + for(size_t i = 0; i < sizeof JUMP / sizeof *JUMP; i++) for(int b = 0; b < 64; b++) { if (JUMP[i] & 1ULL << b) @@ -306,7 +306,7 @@ getosrandom (void *buf, size_t buflen) /* rand_s is available in MinGW-w64 but not plain MinGW. */ #if defined(__MINGW64_VERSION_MAJOR) unsigned int* b = buf; - for (unsigned i = 0; i < buflen / sizeof (unsigned int); i++) + for (size_t i = 0; i < buflen / sizeof (unsigned int); i++) rand_s (&b[i]); return buflen; #else @@ -462,14 +462,12 @@ arandom_r4 (gfc_array_r4 *x) index_type dim; GFC_REAL_4 *dest; xorshift1024star_state* rs = get_rand_state(); - int n; - dest = x->base_addr; dim = GFC_DESCRIPTOR_RANK (x); - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(x,n); @@ -494,7 +492,7 @@ arandom_r4 (gfc_array_r4 *x) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment @@ -531,13 +529,12 @@ arandom_r8 (gfc_array_r8 *x) index_type dim; GFC_REAL_8 *dest; xorshift1024star_state* rs = get_rand_state(); - int n; dest = x->base_addr; dim = GFC_DESCRIPTOR_RANK (x); - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(x,n); @@ -561,7 +558,7 @@ arandom_r8 (gfc_array_r8 *x) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment @@ -600,13 +597,12 @@ arandom_r10 (gfc_array_r10 *x) index_type dim; GFC_REAL_10 *dest; xorshift1024star_state* rs = get_rand_state(); - int n; dest = x->base_addr; dim = GFC_DESCRIPTOR_RANK (x); - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(x,n); @@ -630,7 +626,7 @@ arandom_r10 (gfc_array_r10 *x) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment @@ -671,13 +667,12 @@ arandom_r16 (gfc_array_r16 *x) index_type dim; GFC_REAL_16 *dest; xorshift1024star_state* rs = get_rand_state(); - int n; dest = x->base_addr; dim = GFC_DESCRIPTOR_RANK (x); - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(x,n); @@ -702,7 +697,7 @@ arandom_r16 (gfc_array_r16 *x) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment @@ -751,7 +746,7 @@ static const uint64_t xor_keys[] = { static void scramble_seed (uint64_t *dest, const uint64_t *src) { - for (int i = 0; i < (int) SZU64; i++) + for (size_t i = 0; i < SZU64; i++) dest[i] = src[i] ^ xor_keys[i]; } diff --git a/libgfortran/m4/cshift1.m4 b/libgfortran/m4/cshift1.m4 index bf1c7478404..504d4d00bc7 100644 --- a/libgfortran/m4/cshift1.m4 +++ b/libgfortran/m4/cshift1.m4 @@ -78,12 +78,10 @@ cshift1 (gfc_array_char * const restrict ret, if (ret->base_addr == NULL) { - int i; - ret->base_addr = xmallocarray (arraysize, size); ret->offset = 0; GFC_DTYPE_COPY(ret,array); - for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) + for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) { index_type ub, str; diff --git a/libgfortran/m4/eoshift1.m4 b/libgfortran/m4/eoshift1.m4 index aab46fd08a5..ab3f6ce6a19 100644 --- a/libgfortran/m4/eoshift1.m4 +++ b/libgfortran/m4/eoshift1.m4 @@ -85,11 +85,9 @@ eoshift1 (gfc_array_char * const restrict ret, arraysize = size0 ((array_t *) array); if (ret->base_addr == NULL) { - int i; - ret->offset = 0; GFC_DTYPE_COPY(ret,array); - for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) + for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) { index_type ub, str; diff --git a/libgfortran/m4/eoshift3.m4 b/libgfortran/m4/eoshift3.m4 index a8077496760..504cc7ba93a 100644 --- a/libgfortran/m4/eoshift3.m4 +++ b/libgfortran/m4/eoshift3.m4 @@ -86,12 +86,10 @@ eoshift3 (gfc_array_char * const restrict ret, if (ret->base_addr == NULL) { - int i; - ret->base_addr = xmallocarray (arraysize, size); ret->offset = 0; GFC_DTYPE_COPY(ret,array); - for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) + for (index_type i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) { index_type ub, str; diff --git a/libgfortran/m4/in_pack.m4 b/libgfortran/m4/in_pack.m4 index 5da0a87a571..2dce24bc03f 100644 --- a/libgfortran/m4/in_pack.m4 +++ b/libgfortran/m4/in_pack.m4 @@ -46,7 +46,6 @@ internal_pack_'rtype_ccode` ('rtype` * source) const 'rtype_name` *src; 'rtype_name` * restrict dest; 'rtype_name` *destptr; - int n; int packed; /* TODO: Investigate how we can figure out if this is a temporary @@ -55,7 +54,7 @@ internal_pack_'rtype_ccode` ('rtype` * source) dim = GFC_DESCRIPTOR_RANK (source); ssize = 1; packed = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -91,7 +90,7 @@ internal_pack_'rtype_ccode` ('rtype` * source) src += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/m4/in_unpack.m4 b/libgfortran/m4/in_unpack.m4 index 776bbbf886e..b6ca9b242fe 100644 --- a/libgfortran/m4/in_unpack.m4 +++ b/libgfortran/m4/in_unpack.m4 @@ -42,7 +42,6 @@ internal_unpack_'rtype_ccode` ('rtype` * d, const 'rtype_name` * src) index_type dim; index_type dsize; 'rtype_name` * restrict dest; - int n; dest = d->base_addr; if (src == dest || !src) @@ -50,7 +49,7 @@ internal_unpack_'rtype_ccode` ('rtype` * d, const 'rtype_name` * src) dim = GFC_DESCRIPTOR_RANK (d); dsize = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(d,n); @@ -80,7 +79,7 @@ internal_unpack_'rtype_ccode` ('rtype` * d, const 'rtype_name` * src) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/m4/reshape.m4 b/libgfortran/m4/reshape.m4 index 79cbca3feed..108911685de 100644 --- a/libgfortran/m4/reshape.m4 +++ b/libgfortran/m4/reshape.m4 @@ -76,8 +76,6 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret, const 'rtype_name` *pptr; const 'rtype_name` *src; - int n; - int dim; int sempty, pempty, shape_empty; index_type shape_data[GFC_MAX_DIMENSIONS]; @@ -91,7 +89,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret, shape_empty = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)]; if (shape_data[n] <= 0) @@ -106,7 +104,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret, index_type alloc_size; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rex = shape_data[n]; @@ -133,7 +131,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret, pdim = GFC_DESCRIPTOR_RANK (pad); psize = 1; pempty = 0; - for (n = 0; n < pdim; n++) + for (index_type n = 0; n < pdim; n++) { pcount[n] = 0; pstride[n] = GFC_DESCRIPTOR_STRIDE(pad,n); @@ -164,7 +162,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret, index_type ret_extent, source_extent; rs = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { rs *= shape_data[n]; ret_extent = GFC_DESCRIPTOR_EXTENT(ret,n); @@ -177,7 +175,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret, source_extent = 1; sdim = GFC_DESCRIPTOR_RANK (source); - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { index_type se; se = GFC_DESCRIPTOR_EXTENT(source,n); @@ -194,10 +192,10 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret, int seen[GFC_MAX_DIMENSIONS]; index_type v; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) seen[n] = 0; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; @@ -215,8 +213,9 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret, } rsize = 1; - for (n = 0; n < rdim; n++) + for (index_type n = 0; n < rdim; n++) { + index_type dim; if (order) dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1; else @@ -247,7 +246,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret, ssize = 1; sempty = 0; - for (n = 0; n < sdim; n++) + for (index_type n = 0; n < sdim; n++) { scount[n] = 0; sstride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -287,7 +286,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret, src = pptr; sptr = pptr; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; @@ -307,7 +306,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret, scount[0]++; /* Advance to the next destination element. */ - n = 0; + index_type n = 0; while (rcount[n] == rextent[n]) { /* When we get to the end of a dimension, reset it and increment @@ -347,7 +346,7 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret, /* Switch to the pad array. */ sptr = NULL; sdim = pdim; - for (dim = 0; dim < pdim; dim++) + for (index_type dim = 0; dim < pdim; dim++) { scount[dim] = pcount[dim]; sextent[dim] = pextent[dim]; diff --git a/libgfortran/m4/shape.m4 b/libgfortran/m4/shape.m4 index c355ca131d9..ac0b88038a3 100644 --- a/libgfortran/m4/shape.m4 +++ b/libgfortran/m4/shape.m4 @@ -37,12 +37,10 @@ void shape_'rtype_kind` ('rtype` * const restrict ret, const array_t * const restrict array) { - int n; index_type stride; index_type extent; - int rank; - rank = GFC_DESCRIPTOR_RANK (array); + int rank = GFC_DESCRIPTOR_RANK (array); if (ret->base_addr == NULL) { @@ -56,7 +54,7 @@ shape_'rtype_kind` ('rtype` * const restrict ret, if (GFC_DESCRIPTOR_EXTENT(ret,0) < 1) return; - for (n = 0; n < rank; n++) + for (index_type n = 0; n < rank; n++) { extent = GFC_DESCRIPTOR_EXTENT(array,n); ret->base_addr[n * stride] = extent > 0 ? extent : 0 ; diff --git a/libgfortran/m4/spread.m4 b/libgfortran/m4/spread.m4 index e8c52aad144..b5a0b4ed363 100644 --- a/libgfortran/m4/spread.m4 +++ b/libgfortran/m4/spread.m4 @@ -228,10 +228,8 @@ spread_'rtype_code` ('rtype` *ret, const 'rtype` *source, void spread_scalar_'rtype_code` ('rtype` *ret, const 'rtype_name` *source, - const index_type along, const index_type pncopies) + const index_type along, const index_type ncopies) { - int n; - int ncopies = pncopies; 'rtype_name` * restrict dest; index_type stride; @@ -257,7 +255,7 @@ spread_scalar_'rtype_code` ('rtype` *ret, const 'rtype_name` *source, dest = ret->base_addr; stride = GFC_DESCRIPTOR_STRIDE(ret,0); - for (n = 0; n < ncopies; n++) + for (index_type n = 0; n < ncopies; n++) { *dest = *source; dest += stride; diff --git a/libgfortran/runtime/bounds.c b/libgfortran/runtime/bounds.c index b749db11d22..35af02cb3d9 100644 --- a/libgfortran/runtime/bounds.c +++ b/libgfortran/runtime/bounds.c @@ -62,7 +62,6 @@ bounds_ifunction_return (array_t * a, const index_type * extent, const char * a_name, const char * intrinsic) { int empty; - int n; int rank; index_type a_size; @@ -70,7 +69,7 @@ bounds_ifunction_return (array_t * a, const index_type * extent, a_size = size0 (a); empty = 0; - for (n = 0; n < rank; n++) + for (index_type n = 0; n < rank; n++) { if (extent[n] == 0) empty = 1; @@ -89,7 +88,7 @@ bounds_ifunction_return (array_t * a, const index_type * extent, " intrinsic: should not be zero-sized", a_name, intrinsic); - for (n = 0; n < rank; n++) + for (index_type n = 0; n < rank; n++) { index_type a_extent; a_extent = GFC_DESCRIPTOR_EXTENT(a, n); diff --git a/libgfortran/runtime/in_pack_generic.c b/libgfortran/runtime/in_pack_generic.c index 1bc91367f61..0721ac837ff 100644 --- a/libgfortran/runtime/in_pack_generic.c +++ b/libgfortran/runtime/in_pack_generic.c @@ -41,7 +41,6 @@ internal_pack (gfc_array_char * source) const char *src; char *dest; void *destptr; - int n; int packed; index_type size; index_type type_size; @@ -163,7 +162,7 @@ internal_pack (gfc_array_char * source) dim = GFC_DESCRIPTOR_RANK (source); ssize = 1; packed = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(source,n); @@ -199,7 +198,7 @@ internal_pack (gfc_array_char * source) src += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment diff --git a/libgfortran/runtime/in_unpack_generic.c b/libgfortran/runtime/in_unpack_generic.c index 3df8ba55d36..866b4f0f5ec 100644 --- a/libgfortran/runtime/in_unpack_generic.c +++ b/libgfortran/runtime/in_unpack_generic.c @@ -40,8 +40,7 @@ internal_unpack (gfc_array_char * d, const void * s) index_type dsize; char *dest; const char *src; - int n; - int size; + index_type size; int type_size; dest = d->base_addr; @@ -190,7 +189,7 @@ internal_unpack (gfc_array_char * d, const void * s) dim = GFC_DESCRIPTOR_RANK (d); dsize = 1; - for (n = 0; n < dim; n++) + for (index_type n = 0; n < dim; n++) { count[n] = 0; stride[n] = GFC_DESCRIPTOR_STRIDE(d,n); @@ -223,7 +222,7 @@ internal_unpack (gfc_array_char * d, const void * s) dest += stride0; count[0]++; /* Advance to the next source element. */ - n = 0; + index_type n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment