]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/product_i2.c
Update copyright years.
[thirdparty/gcc.git] / libgfortran / generated / product_i2.c
index e99e3e340f80de87c60f9fc6780b7f544be0f634..bf3f68b73c0c1268e7905fd684037d4899e552d8 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of the PRODUCT intrinsic
-   Copyright (C) 2002-2018 Free Software Foundation, Inc.
+   Copyright (C) 2002-2022 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran runtime library (libgfortran).
@@ -100,7 +100,7 @@ product_i2 (gfc_array_i2 * const restrict retarray,
        }
 
       retarray->offset = 0;
-      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+      retarray->dtype.rank = rank;
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
@@ -150,8 +150,10 @@ product_i2 (gfc_array_i2 * const restrict retarray,
          *dest = 1;
        else
          {
+#if ! defined HAVE_BACK_ARG
            for (n = 0; n < len; n++, src += delta)
              {
+#endif
 
   result *= *src;
              }
@@ -218,6 +220,16 @@ mproduct_i2 (gfc_array_i2 * const restrict retarray,
   index_type mdelta;
   int mask_kind;
 
+  if (mask == NULL)
+    {
+#ifdef HAVE_BACK_ARG
+      product_i2 (retarray, array, pdim, back);
+#else
+      product_i2 (retarray, array, pdim);
+#endif
+      return;
+    }
+
   dim = (*pdim) - 1;
   rank = GFC_DESCRIPTOR_RANK (array) - 1;
 
@@ -287,7 +299,7 @@ mproduct_i2 (gfc_array_i2 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       retarray->offset = 0;
-      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+      retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
        {
@@ -397,9 +409,13 @@ sproduct_i2 (gfc_array_i2 * const restrict retarray,
   index_type dim;
 
 
-  if (*mask)
+  if (mask == NULL || *mask)
     {
+#ifdef HAVE_BACK_ARG
+      product_i2 (retarray, array, pdim, back);
+#else
       product_i2 (retarray, array, pdim);
+#endif
       return;
     }
   /* Make dim zero based to avoid confusion.  */
@@ -446,7 +462,7 @@ sproduct_i2 (gfc_array_i2 * const restrict retarray,
        }
 
       retarray->offset = 0;
-      retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
+      retarray->dtype.rank = rank;
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];