]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/sum_c10.c
re PR fortran/82995 (Segmentation fault passing optional argument to intrinsic sum...
[thirdparty/gcc.git] / libgfortran / generated / sum_c10.c
index e20b4edb373490c45540b89d5d77ca662f632fe1..d7f1e73435a5e4ac6092869a3180d79d66c0d420 100644 (file)
@@ -220,6 +220,16 @@ msum_c10 (gfc_array_c10 * const restrict retarray,
   index_type mdelta;
   int mask_kind;
 
+  if (mask == NULL)
+    {
+#ifdef HAVE_BACK_ARG
+      sum_c10 (retarray, array, pdim, back);
+#else
+      sum_c10 (retarray, array, pdim);
+#endif
+      return;
+    }
+
   dim = (*pdim) - 1;
   rank = GFC_DESCRIPTOR_RANK (array) - 1;
 
@@ -399,7 +409,7 @@ ssum_c10 (gfc_array_c10 * const restrict retarray,
   index_type dim;
 
 
-  if (*mask)
+  if (mask == NULL || *mask)
     {
 #ifdef HAVE_BACK_ARG
       sum_c10 (retarray, array, pdim, back);