summaryrefslogtreecommitdiff
path: root/libgfortran/generated/maxloc0_4_r4.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/generated/maxloc0_4_r4.c')
-rw-r--r--libgfortran/generated/maxloc0_4_r4.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libgfortran/generated/maxloc0_4_r4.c b/libgfortran/generated/maxloc0_4_r4.c
index 260c3d35e66..f5dba470153 100644
--- a/libgfortran/generated/maxloc0_4_r4.c
+++ b/libgfortran/generated/maxloc0_4_r4.c
@@ -106,7 +106,7 @@ maxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
/* Initialize the return value. */
for (n = 0; n < rank; n++)
- dest[n * dstride] = 1;
+ dest[n * dstride] = 0;
{
GFC_REAL_4 maxval;
@@ -118,7 +118,7 @@ maxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
{
/* Implementation start. */
- if (*base > maxval)
+ if (*base > maxval || !dest[0])
{
maxval = *base;
for (n = 0; n < rank; n++)
@@ -241,7 +241,7 @@ mmaxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
/* Initialize the return value. */
for (n = 0; n < rank; n++)
- dest[n * dstride] = 1;
+ dest[n * dstride] = 0;
{
GFC_REAL_4 maxval;
@@ -253,7 +253,7 @@ mmaxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
{
/* Implementation start. */
- if (*mbase && *base > maxval)
+ if (*mbase && (*base > maxval || !dest[0]))
{
maxval = *base;
for (n = 0; n < rank; n++)