From b1660f25a3a95c3fe3682faa921b21f7493356f8 Mon Sep 17 00:00:00 2001 From: pault Date: Mon, 13 Mar 2006 22:49:56 +0000 Subject: 2006-03-13 Paul Thomas PR fortran/25378 * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Set the initial position to zero and modify the condition for updating it, to implement the F2003 requirement for all(mask) is false. 2006-03-13 Paul Thomas PR fortran/25378 * libgfortran/m4/minloc1.m4: Set the initial position to zero and modify the condition for updating it, to implement the F2003 requirement for all(mask).eq.false. * libgfortran/m4/maxloc1.m4: The same. * libgfortran/m4/iforeach.m4: The same. * libgfortran/m4/minloc0.m4: The same. * libgfortran/m4/maxloc0.m4: The same. * libgfortran/generated/maxloc0_16_i16.c: Regenerated, together with 41 others. * libgfortran/generated/minloc0_16_i16.c: Regenerated, together with 41 others. 2006-03-13 Paul Thomas PR fortran/25378 * gfortran.fortran-torture/execute/intrinsic_mmloc_3.f90: Expand test to include more permuatations of mask and index. * testsuite/gfortran.dg/scalar_mask_1.f90: Modify last test to respond to F2003 spec. that the position returned for an all false mask && condition is zero. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112028 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgfortran/generated/maxloc1_4_r4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libgfortran/generated/maxloc1_4_r4.c') diff --git a/libgfortran/generated/maxloc1_4_r4.c b/libgfortran/generated/maxloc1_4_r4.c index dd0de4b9ee0..3795ed80d55 100644 --- a/libgfortran/generated/maxloc1_4_r4.c +++ b/libgfortran/generated/maxloc1_4_r4.c @@ -132,7 +132,7 @@ maxloc1_4_r4 (gfc_array_i4 * const restrict retarray, GFC_REAL_4 maxval; maxval = -GFC_REAL_4_HUGE; - result = 1; + result = 0; if (len <= 0) *dest = 0; else @@ -140,7 +140,7 @@ maxloc1_4_r4 (gfc_array_i4 * const restrict retarray, for (n = 0; n < len; n++, src += delta) { - if (*src > maxval) + if (*src > maxval || !result) { maxval = *src; result = (GFC_INTEGER_4)n + 1; @@ -299,7 +299,7 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray, GFC_REAL_4 maxval; maxval = -GFC_REAL_4_HUGE; - result = 1; + result = 0; if (len <= 0) *dest = 0; else @@ -307,7 +307,7 @@ mmaxloc1_4_r4 (gfc_array_i4 * 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_4)n + 1; -- cgit v1.2.1