]> rtime.felk.cvut.cz Git - l4.git/blobdiff - l4/pkg/libgfortran/lib/contrib/generated/iall_i8.c
Update
[l4.git] / l4 / pkg / libgfortran / lib / contrib / generated / iall_i8.c
index 2c5aa0953af83d48859e6a4975615d89ecea3da0..0c55494d4241c3a48bfb131fc163cf80768428a9 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of the IALL intrinsic
-   Copyright 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010-2015 Free Software Foundation, Inc.
    Contributed by Tobias Burnus <burnus@net-b.de>
 
 This file is part of the GNU Fortran runtime library (libgfortran).
@@ -79,7 +79,7 @@ iall_i8 (gfc_array_i8 * const restrict retarray,
        extent[n] = 0;
     }
 
-  if (retarray->data == NULL)
+  if (retarray->base_addr == NULL)
     {
       size_t alloc_size, str;
 
@@ -97,9 +97,9 @@ iall_i8 (gfc_array_i8 * const restrict retarray,
       retarray->offset = 0;
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
-                  * extent[rank-1];
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
        {
          /* Make sure we have a zero-sized array.  */
@@ -107,8 +107,6 @@ iall_i8 (gfc_array_i8 * const restrict retarray,
          return;
 
        }
-      else
-       retarray->data = internal_malloc_size (alloc_size);
     }
   else
     {
@@ -131,8 +129,8 @@ iall_i8 (gfc_array_i8 * const restrict retarray,
        return;
     }
 
-  base = array->data;
-  dest = retarray->data;
+  base = array->base_addr;
+  dest = retarray->base_addr;
 
   continue_loop = 1;
   while (continue_loop)
@@ -222,7 +220,7 @@ miall_i8 (gfc_array_i8 * const restrict retarray,
   if (len <= 0)
     return;
 
-  mbase = mask->data;
+  mbase = mask->base_addr;
 
   mask_kind = GFC_DESCRIPTOR_SIZE (mask);
 
@@ -258,7 +256,7 @@ miall_i8 (gfc_array_i8 * const restrict retarray,
        extent[n] = 0;
     }
 
-  if (retarray->data == NULL)
+  if (retarray->base_addr == NULL)
     {
       size_t alloc_size, str;
 
@@ -273,8 +271,7 @@ miall_i8 (gfc_array_i8 * const restrict retarray,
 
        }
 
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
-                  * extent[rank-1];
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       retarray->offset = 0;
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -286,7 +283,7 @@ miall_i8 (gfc_array_i8 * const restrict retarray,
          return;
        }
       else
-       retarray->data = internal_malloc_size (alloc_size);
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
     }
   else
@@ -311,8 +308,8 @@ miall_i8 (gfc_array_i8 * const restrict retarray,
        return;
     }
 
-  dest = retarray->data;
-  base = array->data;
+  dest = retarray->base_addr;
+  base = array->base_addr;
 
   while (base)
     {
@@ -324,18 +321,13 @@ miall_i8 (gfc_array_i8 * const restrict retarray,
       {
 
   result = 0;
-       if (len <= 0)
-         *dest = 0;
-       else
+       for (n = 0; n < len; n++, src += delta, msrc += mdelta)
          {
-           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-             {
 
   if (*msrc)
     result &= *src;
-             }
-           *dest = result;
          }
+       *dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
@@ -418,7 +410,7 @@ siall_i8 (gfc_array_i8 * const restrict retarray,
        extent[n] = 0;
     }
 
-  if (retarray->data == NULL)
+  if (retarray->base_addr == NULL)
     {
       size_t alloc_size, str;
 
@@ -436,8 +428,7 @@ siall_i8 (gfc_array_i8 * const restrict retarray,
       retarray->offset = 0;
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
-                  * extent[rank-1];
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
        {
@@ -446,7 +437,7 @@ siall_i8 (gfc_array_i8 * const restrict retarray,
          return;
        }
       else
-       retarray->data = internal_malloc_size (alloc_size);
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
   else
     {
@@ -478,7 +469,7 @@ siall_i8 (gfc_array_i8 * const restrict retarray,
       dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
     }
 
-  dest = retarray->data;
+  dest = retarray->base_addr;
 
   while(1)
     {