OSDN Git Service

PR fortran/26025
[pf3gnuchains/gcc-fork.git] / libgfortran / generated / count_8_l16.c
index 4df2aeb..87c291e 100644 (file)
@@ -37,18 +37,21 @@ Boston, MA 02110-1301, USA.  */
 #if defined (HAVE_GFC_LOGICAL_16) && defined (HAVE_GFC_INTEGER_8)
 
 
-extern void count_8_l16 (gfc_array_i8 *, gfc_array_l16 *, index_type *);
+extern void count_8_l16 (gfc_array_i8 * const restrict, 
+       gfc_array_l16 * const restrict, const index_type * const restrict);
 export_proto(count_8_l16);
 
 void
-count_8_l16 (gfc_array_i8 *retarray, gfc_array_l16 *array, index_type *pdim)
+count_8_l16 (gfc_array_i8 * const restrict retarray, 
+       gfc_array_l16 * const restrict array, 
+       const index_type * const restrict pdim)
 {
   index_type count[GFC_MAX_DIMENSIONS];
   index_type extent[GFC_MAX_DIMENSIONS];
   index_type sstride[GFC_MAX_DIMENSIONS];
   index_type dstride[GFC_MAX_DIMENSIONS];
-  GFC_LOGICAL_16 *base;
-  GFC_INTEGER_8 *dest;
+  const GFC_LOGICAL_16 * restrict base;
+  GFC_INTEGER_8 * restrict dest;
   index_type rank;
   index_type n;
   index_type len;
@@ -59,11 +62,6 @@ count_8_l16 (gfc_array_i8 *retarray, gfc_array_l16 *array, index_type *pdim)
   dim = (*pdim) - 1;
   rank = GFC_DESCRIPTOR_RANK (array) - 1;
 
-  /* TODO:  It should be a front end job to correctly set the strides.  */
-
-  if (array->dim[0].stride == 0)
-    array->dim[0].stride = 1;
-
   len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
   delta = array->dim[dim].stride;
 
@@ -100,9 +98,6 @@ count_8_l16 (gfc_array_i8 *retarray, gfc_array_l16 *array, index_type *pdim)
     }
   else
     {
-      if (retarray->dim[0].stride == 0)
-       retarray->dim[0].stride = 1;
-
       if (rank != GFC_DESCRIPTOR_RANK (retarray))
        runtime_error ("rank of return array incorrect");
     }
@@ -120,7 +115,7 @@ count_8_l16 (gfc_array_i8 *retarray, gfc_array_l16 *array, index_type *pdim)
 
   while (base)
     {
-      GFC_LOGICAL_16 *src;
+      const GFC_LOGICAL_16 * restrict src;
       GFC_INTEGER_8 result;
       src = base;
       {
@@ -150,7 +145,7 @@ count_8_l16 (gfc_array_i8 *retarray, gfc_array_l16 *array, index_type *pdim)
              the next dimension.  */
           count[n] = 0;
           /* We could precalculate these products, but this is a less
-             frequently used path so proabably not worth it.  */
+             frequently used path so probably not worth it.  */
           base -= sstride[n] * extent[n];
           dest -= dstride[n] * extent[n];
           n++;