diff options
Diffstat (limited to 'libgfortran/generated/maxloc1_8_i16.c')
-rw-r--r-- | libgfortran/generated/maxloc1_8_i16.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libgfortran/generated/maxloc1_8_i16.c b/libgfortran/generated/maxloc1_8_i16.c index 8feecfaaf7d..69cb35ec5f9 100644 --- a/libgfortran/generated/maxloc1_8_i16.c +++ b/libgfortran/generated/maxloc1_8_i16.c @@ -132,7 +132,7 @@ maxloc1_8_i16 (gfc_array_i8 * const restrict retarray, GFC_INTEGER_16 maxval; maxval = -GFC_INTEGER_16_HUGE; - result = 1; + result = 0; if (len <= 0) *dest = 0; else @@ -140,7 +140,7 @@ maxloc1_8_i16 (gfc_array_i8 * const restrict retarray, for (n = 0; n < len; n++, src += delta) { - if (*src > maxval) + if (*src > maxval || !result) { maxval = *src; result = (GFC_INTEGER_8)n + 1; @@ -299,7 +299,7 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray, GFC_INTEGER_16 maxval; maxval = -GFC_INTEGER_16_HUGE; - result = 1; + result = 0; if (len <= 0) *dest = 0; else @@ -307,7 +307,7 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray, for (n = 0; n < len; n++, src += delta, msrc += mdelta) { - if (*msrc && *src > maxval) + if (*msrc && (*src > maxval || !result)) { maxval = *src; result = (GFC_INTEGER_8)n + 1; |