X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=libgfortran%2Fgenerated%2Fproduct_i4.c;h=16c6f6e10ae8c6785dc31f82d8685b6cee23086b;hb=83ffe9cde7fe0b4deb0d1b54175fd9b19c38179c;hp=1328055736a65a9910974e12f40126fac1fff1c6;hpb=cfdf6ff61b8107d124f41c426d65acf8b5ad8cf5;p=thirdparty%2Fgcc.git diff --git a/libgfortran/generated/product_i4.c b/libgfortran/generated/product_i4.c index 1328055736a6..16c6f6e10ae8 100644 --- a/libgfortran/generated/product_i4.c +++ b/libgfortran/generated/product_i4.c @@ -1,5 +1,5 @@ /* Implementation of the PRODUCT intrinsic - Copyright (C) 2002-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2023 Free Software Foundation, Inc. Contributed by Paul Brook This file is part of the GNU Fortran runtime library (libgfortran). @@ -100,7 +100,7 @@ product_i4 (gfc_array_i4 * 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_i4 (gfc_array_i4 * 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_i4 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + product_i4 (retarray, array, pdim, back); +#else + product_i4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -287,7 +299,7 @@ mproduct_i4 (gfc_array_i4 * 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_i4 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { +#ifdef HAVE_BACK_ARG + product_i4 (retarray, array, pdim, back); +#else product_i4 (retarray, array, pdim); +#endif return; } /* Make dim zero based to avoid confusion. */ @@ -446,7 +462,7 @@ sproduct_i4 (gfc_array_i4 * 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];