OSDN Git Service

* config/i386/i386.c (ix86_expand_movmem, ix86_expand_setmem): Add
[pf3gnuchains/gcc-fork.git] / libgfortran / generated / any_l1.c
index 8975438..3b2be3e 100644 (file)
@@ -57,6 +57,7 @@ any_l1 (gfc_array_l1 * const restrict retarray,
   index_type delta;
   index_type dim;
   int src_kind;
+  int continue_loop;
 
   /* Make dim zero based to avoid confusion.  */
   dim = (*pdim) - 1;
@@ -65,6 +66,9 @@ any_l1 (gfc_array_l1 * const restrict retarray,
   src_kind = GFC_DESCRIPTOR_SIZE (array);
 
   len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+  if (len < 0)
+    len = 0;
+
   delta = array->dim[dim].stride * src_kind;
 
   for (n = 0; n < dim; n++)
@@ -123,7 +127,7 @@ any_l1 (gfc_array_l1 * const restrict retarray,
                       (long int) GFC_DESCRIPTOR_RANK (retarray),
                       (long int) rank);
 
-      if (compile_options.bounds_check)
+      if (unlikely (compile_options.bounds_check))
        {
          for (n=0; n < rank; n++)
            {
@@ -134,7 +138,7 @@ any_l1 (gfc_array_l1 * const restrict retarray,
              if (extent[n] != ret_extent)
                runtime_error ("Incorrect extent in return value of"
                               " ANY intrinsic in dimension %d:"
-                              " is %ld, should be %ld", n + 1,
+                              " is %ld, should be %ld", (int) n + 1,
                               (long int) ret_extent, (long int) extent[n]);
            }
        }
@@ -164,7 +168,8 @@ any_l1 (gfc_array_l1 * const restrict retarray,
 
   dest = retarray->data;
 
-  while (base)
+  continue_loop = 1;
+  while (continue_loop)
     {
       const GFC_LOGICAL_1 * restrict src;
       GFC_LOGICAL_1 result;
@@ -207,7 +212,7 @@ any_l1 (gfc_array_l1 * const restrict retarray,
           if (n == rank)
             {
               /* Break out of the look.  */
-              base = NULL;
+              continue_loop = 0;
               break;
             }
           else