diff libgfortran/generated/maxloc0_8_s1.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
line wrap: on
line diff
--- a/libgfortran/generated/maxloc0_8_s1.c	Thu Oct 25 07:37:49 2018 +0900
+++ b/libgfortran/generated/maxloc0_8_s1.c	Thu Feb 13 11:34:05 2020 +0900
@@ -1,5 +1,5 @@
 /* Implementation of the MAXLOC intrinsic
-   Copyright (C) 2017-2018 Free Software Foundation, Inc.
+   Copyright (C) 2017-2020 Free Software Foundation, Inc.
    Contributed by Thomas Koenig
 
 This file is part of the GNU Fortran runtime library (libgfortran).
@@ -30,14 +30,14 @@
 #include <limits.h>
 
 
-#if defined (HAVE_GFC_INTEGER_1) && defined (HAVE_GFC_INTEGER_8)
+#if defined (HAVE_GFC_UINTEGER_1) && defined (HAVE_GFC_INTEGER_8)
 
 #define HAVE_BACK_ARG 1
 
 static inline int
-compare_fcn (const GFC_INTEGER_1 *a, const GFC_INTEGER_1 *b, gfc_charlen_type n)
+compare_fcn (const GFC_UINTEGER_1 *a, const GFC_UINTEGER_1 *b, gfc_charlen_type n)
 {
-  if (sizeof (GFC_INTEGER_1) == 1)
+  if (sizeof (GFC_UINTEGER_1) == 1)
     return memcmp (a, b, n);
   else
     return memcmp_char4 (a, b, n);
@@ -56,7 +56,7 @@
   index_type extent[GFC_MAX_DIMENSIONS];
   index_type sstride[GFC_MAX_DIMENSIONS];
   index_type dstride;
-  const GFC_INTEGER_1 *base;
+  const GFC_UINTEGER_1 *base;
   GFC_INTEGER_8 * restrict dest;
   index_type rank;
   index_type n;
@@ -102,7 +102,7 @@
     dest[n * dstride] = 1;
   {
 
-  const GFC_INTEGER_1 *maxval;
+  const GFC_UINTEGER_1 *maxval;
    maxval = NULL;
 
   while (base)
@@ -168,12 +168,22 @@
   index_type mstride[GFC_MAX_DIMENSIONS];
   index_type dstride;
   GFC_INTEGER_8 *dest;
-  const GFC_INTEGER_1 *base;
+  const GFC_UINTEGER_1 *base;
   GFC_LOGICAL_1 *mbase;
   int rank;
   index_type n;
   int mask_kind;
 
+  if (mask == NULL)
+    {
+#ifdef HAVE_BACK_ARG    
+      maxloc0_8_s1 (retarray, array, back, len);
+#else
+      maxloc0_8_s1 (retarray, array, len);
+#endif
+      return;
+    }
+
   rank = GFC_DESCRIPTOR_RANK (array);
   if (rank <= 0)
     runtime_error ("Rank of array needs to be > 0");
@@ -234,7 +244,7 @@
     dest[n * dstride] = 0;
   {
 
-  const GFC_INTEGER_1 *maxval;
+  const GFC_UINTEGER_1 *maxval;
 
   maxval = NULL;
 
@@ -304,7 +314,7 @@
   index_type n;
   GFC_INTEGER_8 *dest;
 
-  if (*mask)
+  if (mask == NULL || *mask)
     {
 #ifdef HAVE_BACK_ARG    
       maxloc0_8_s1 (retarray, array, back, len);