X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=libgfortran%2Fgenerated%2Fsum_i8.c;h=012a97c50cc97f62dd2a11a0e06642a214776479;hb=7adcbafe45f8001b698967defe682687b52c0007;hp=53f6ec24fd4896bec671597caee14614cf7ecc16;hpb=64b1806b2d94fd325759761b64fb7507ca83d5d2;p=thirdparty%2Fgcc.git diff --git a/libgfortran/generated/sum_i8.c b/libgfortran/generated/sum_i8.c index 53f6ec24fd48..012a97c50cc9 100644 --- a/libgfortran/generated/sum_i8.c +++ b/libgfortran/generated/sum_i8.c @@ -1,5 +1,5 @@ /* Implementation of the SUM intrinsic - Copyright (C) 2002-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2022 Free Software Foundation, Inc. Contributed by Paul Brook This file is part of the GNU Fortran 95 runtime library (libgfortran). @@ -51,10 +51,6 @@ sum_i8 (gfc_array_i8 * const restrict retarray, index_type dim; int continue_loop; -#ifdef HAVE_BACK_ARG - assert(back == 0); -#endif - /* Make dim zero based to avoid confusion. */ rank = GFC_DESCRIPTOR_RANK (array) - 1; dim = (*pdim) - 1; @@ -104,7 +100,7 @@ sum_i8 (gfc_array_i8 * const restrict retarray, } retarray->offset = 0; - GFC_DTYPE_COPY_SETRANK(retarray,array,rank); + retarray->dtype.rank = rank; alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; @@ -154,8 +150,10 @@ sum_i8 (gfc_array_i8 * const restrict retarray, *dest = 0; else { +#if ! defined HAVE_BACK_ARG for (n = 0; n < len; n++, src += delta) { +#endif result += *src; } @@ -222,9 +220,16 @@ msum_i8 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { #ifdef HAVE_BACK_ARG - assert (back == 0); + sum_i8 (retarray, array, pdim, back); +#else + sum_i8 (retarray, array, pdim); #endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -294,7 +299,7 @@ msum_i8 (gfc_array_i8 * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; retarray->offset = 0; - GFC_DTYPE_COPY_SETRANK(retarray,array,rank); + retarray->dtype.rank = rank; if (alloc_size == 0) { @@ -404,7 +409,7 @@ ssum_i8 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG sum_i8 (retarray, array, pdim, back); @@ -457,7 +462,7 @@ ssum_i8 (gfc_array_i8 * const restrict retarray, } retarray->offset = 0; - GFC_DTYPE_COPY_SETRANK(retarray,array,rank); + retarray->dtype.rank = rank; alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];