/* Implementation of the MAXVAL intrinsic
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2020 Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org>
This file is part of the GNU Fortran runtime library (libgfortran).
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;
}
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];
*dest = (-GFC_INTEGER_4_HUGE-1);
else
{
+#if ! defined HAVE_BACK_ARG
for (n = 0; n < len; n++, src += delta)
{
+#endif
#if defined (GFC_INTEGER_4_QUIET_NAN)
if (*src >= result)
index_type mdelta;
int mask_kind;
+ if (mask == NULL)
+ {
#ifdef HAVE_BACK_ARG
- assert (back == 0);
+ maxval_i4 (retarray, array, pdim, back);
+#else
+ maxval_i4 (retarray, array, pdim);
#endif
+ return;
+ }
+
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
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)
{
index_type dim;
- if (*mask)
+ if (mask == NULL || *mask)
{
#ifdef HAVE_BACK_ARG
maxval_i4 (retarray, array, pdim, back);
}
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];