]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/minloc1_4_i16.c
re PR fortran/82995 (Segmentation fault passing optional argument to intrinsic sum...
[thirdparty/gcc.git] / libgfortran / generated / minloc1_4_i16.c
index c0b91cf5f263d38969ea49d58de2bad28b3aead3..38b1141c5ce773559694d1d1a37de5c682d0b3a0 100644 (file)
@@ -258,6 +258,16 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
   index_type mdelta;
   int mask_kind;
 
+  if (mask == NULL)
+    {
+#ifdef HAVE_BACK_ARG
+      minloc1_4_i16 (retarray, array, pdim, back);
+#else
+      minloc1_4_i16 (retarray, array, pdim);
+#endif
+      return;
+    }
+
   dim = (*pdim) - 1;
   rank = GFC_DESCRIPTOR_RANK (array) - 1;
 
@@ -480,7 +490,7 @@ sminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
   index_type dim;
 
 
-  if (*mask)
+  if (mask == NULL || *mask)
     {
 #ifdef HAVE_BACK_ARG
       minloc1_4_i16 (retarray, array, pdim, back);