]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/any_l8.c
Update copyright years.
[thirdparty/gcc.git] / libgfortran / generated / any_l8.c
index 47957a77d90e80b5ee9beda673ef08a370e3e6db..d5a995cb39e78ce1adbb01ea36372b8296703158 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of the ANY intrinsic
-   Copyright (C) 2002-2014 Free Software Foundation, Inc.
+   Copyright (C) 2002-2024 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran runtime library (libgfortran).
@@ -24,8 +24,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
 #include "libgfortran.h"
-#include <stdlib.h>
-#include <assert.h>
 
 
 #if defined (HAVE_GFC_LOGICAL_8)
@@ -99,19 +97,13 @@ any_l8 (gfc_array_l8 * const restrict retarray,
         }
 
       retarray->offset = 0;
-      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+      retarray->dtype.rank = rank;
 
-      alloc_size = sizeof (GFC_LOGICAL_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_LOGICAL_8));
       if (alloc_size == 0)
-       {
-         /* Make sure we have a zero-sized array.  */
-         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-         return;
-       }
-      else
-       retarray->base_addr = xmalloc (alloc_size);
+       return;
     }
   else
     {
@@ -202,9 +194,9 @@ any_l8 (gfc_array_l8 * const restrict retarray,
           base -= sstride[n] * extent[n];
           dest -= dstride[n] * extent[n];
           n++;
-          if (n == rank)
+          if (n >= rank)
             {
-              /* Break out of the look.  */
+              /* Break out of the loop.  */
               continue_loop = 0;
               break;
             }