]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/maxloc1_16_s1.c
Update copyright years.
[thirdparty/gcc.git] / libgfortran / generated / maxloc1_16_s1.c
index edc19759a0058a28aba0969713e9d38e48a3a8a8..eddfe5f44cc7faed213ed975f8e2c0ea02c68755 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright (C) 2017-2018 Free Software Foundation, Inc.
+   Copyright (C) 2017-2024 Free Software Foundation, Inc.
    Contributed by Thomas Koenig
 
 This file is part of the GNU Fortran runtime library (libgfortran).
@@ -121,12 +121,7 @@ maxloc1_16_s1 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-       {
-         /* Make sure we have a zero-sized array.  */
-         GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-         return;
-
-       }
+       return;
     }
   else
     {
@@ -263,8 +258,8 @@ mmaxloc1_16_s1 (gfc_array_i16 * const restrict retarray,
     }
 
   len = GFC_DESCRIPTOR_EXTENT(array,dim);
-  if (len <= 0)
-    return;
+  if (len < 0)
+    len = 0;
 
   mbase = mask->base_addr;
 
@@ -322,15 +317,9 @@ mmaxloc1_16_s1 (gfc_array_i16 * const restrict retarray,
       retarray->offset = 0;
       retarray->dtype.rank = rank;
 
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       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 = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
-
+       return;
     }
   else
     {
@@ -503,14 +492,9 @@ smaxloc1_16_s1 (gfc_array_i16 * const restrict retarray,
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       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 = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
+       return;
     }
   else
     {