]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/minloc0_8_s1.c
re PR fortran/82995 (Segmentation fault passing optional argument to intrinsic sum...
[thirdparty/gcc.git] / libgfortran / generated / minloc0_8_s1.c
index e22f4f9fe997368719a7d4416fc0a83a5d23577b..0768abceb90e20b3ac57563c055b4301e6d887bb 100644 (file)
@@ -174,6 +174,16 @@ mminloc0_8_s1 (gfc_array_i8 * const restrict retarray,
   index_type n;
   int mask_kind;
 
+  if (mask == NULL)
+    {
+#ifdef HAVE_BACK_ARG    
+      minloc0_8_s1 (retarray, array, back, len);
+#else
+      minloc0_8_s1 (retarray, array, len);
+#endif
+      return;
+    }
+
   rank = GFC_DESCRIPTOR_RANK (array);
   if (rank <= 0)
     runtime_error ("Rank of array needs to be > 0");
@@ -304,7 +314,7 @@ sminloc0_8_s1 (gfc_array_i8 * const restrict retarray,
   index_type n;
   GFC_INTEGER_8 *dest;
 
-  if (*mask)
+  if (mask == NULL || *mask)
     {
 #ifdef HAVE_BACK_ARG    
       minloc0_8_s1 (retarray, array, back, len);