summaryrefslogtreecommitdiff
path: root/libgfortran/generated/maxloc0_8_r16.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2006-03-13 22:49:56 +0000
committerPaul Thomas <pault@gcc.gnu.org>2006-03-13 22:49:56 +0000
commita4b9e93e5d35d44cc1d13680800c36065e2cbd3e (patch)
treec9b7df7a9552d154d8cf7e2055c0a2c433188f18 /libgfortran/generated/maxloc0_8_r16.c
parent94c5a84153af895ba99c7de5ebd2448e4d80c4d5 (diff)
re PR libfortran/25378 ([Fortran 2003] maxloc for all-false mask)
2006-03-13 Paul Thomas <pault@gcc.gnu.org> 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 <pault@gcc.gnu.org> 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 <pault@gcc.gnu.org> 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. From-SVN: r112028
Diffstat (limited to 'libgfortran/generated/maxloc0_8_r16.c')
-rw-r--r--libgfortran/generated/maxloc0_8_r16.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libgfortran/generated/maxloc0_8_r16.c b/libgfortran/generated/maxloc0_8_r16.c
index d5232a48248..e0d1a427e15 100644
--- a/libgfortran/generated/maxloc0_8_r16.c
+++ b/libgfortran/generated/maxloc0_8_r16.c
@@ -106,7 +106,7 @@ maxloc0_8_r16 (gfc_array_i8 * const restrict retarray,
/* Initialize the return value. */
for (n = 0; n < rank; n++)
- dest[n * dstride] = 1;
+ dest[n * dstride] = 0;
{
GFC_REAL_16 maxval;
@@ -118,7 +118,7 @@ maxloc0_8_r16 (gfc_array_i8 * 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_8_r16 (gfc_array_i8 * const restrict retarray,
/* Initialize the return value. */
for (n = 0; n < rank; n++)
- dest[n * dstride] = 1;
+ dest[n * dstride] = 0;
{
GFC_REAL_16 maxval;
@@ -253,7 +253,7 @@ mmaxloc0_8_r16 (gfc_array_i8 * const restrict retarray,
{
/* Implementation start. */
- if (*mbase && *base > maxval)
+ if (*mbase && (*base > maxval || !dest[0]))
{
maxval = *base;
for (n = 0; n < rank; n++)