]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/findloc0_r4.c
Update copyright years.
[thirdparty/gcc.git] / libgfortran / generated / findloc0_r4.c
index 08d59e956b2fefd18e057884dc0f652cc426d1f1..3fd2c43410040106de4447ff9317ae97ba68d8d0 100644 (file)
@@ -1,6 +1,6 @@
 
 /* Implementation of the FINDLOC intrinsic
-   Copyright (C) 2018 Free Software Foundation, Inc.
+   Copyright (C) 2018-2020 Free Software Foundation, Inc.
    Contributed by Thomas König <tk@tkoenig.net>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -57,7 +57,7 @@ findloc0_r4 (gfc_array_index_type * const restrict retarray,
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
-      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
+      retarray->base_addr = xmallocarray (rank, sizeof (index_type));
     }
   else
     {
@@ -196,7 +196,7 @@ mfindloc0_r4 (gfc_array_index_type * const restrict retarray,
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
-      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
+      retarray->base_addr = xmallocarray (rank, sizeof (index_type));
     }
   else
     {
@@ -342,7 +342,7 @@ sfindloc0_r4 (gfc_array_index_type * const restrict retarray,
   index_type * restrict dest;
   index_type n;
 
-  if (*mask)
+  if (mask == NULL || *mask)
     {
       findloc0_r4 (retarray, array, value, back);
       return;
@@ -358,7 +358,7 @@ sfindloc0_r4 (gfc_array_index_type * const restrict retarray,
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
-      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
+      retarray->base_addr = xmallocarray (rank, sizeof (index_type));
     }
   else if (unlikely (compile_options.bounds_check))
     {