User account creation filtered due to spam.

Bug 20935 - failed assertion for maxloc(n, mask=.true.)
Summary: failed assertion for maxloc(n, mask=.true.)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.1.0
: P2 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
: 26182 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-04-10 22:32 UTC by Thomas Koenig
Modified: 2006-03-29 19:30 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-11-10 04:10:28


Attachments
partial patch (1.47 KB, patch)
2006-03-07 22:33 UTC, Thomas Koenig
Details | Diff
More complete patch (1.84 KB, patch)
2006-03-10 23:07 UTC, Thomas Koenig
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Koenig 2005-04-10 22:32:22 UTC
$ gfortran maxloc.f90
$ ./a.out
a.out: ../../../gcc-4.1/libgfortran/generated/maxloc0_4_i4.c:221: mmaxloc0_4_i4:
Assertion `((mask)->dtype >> 6) == 8' failed.
Aborted
$ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.1/configure --prefix=/home/ig25 --enable-languages=c,f95
Thread model: posix
gcc version 4.1.0 20050410 (experimental)

From the .t02.original file:

    logical4 C.502 = 1;
    struct array2_int4 parm.7;
    struct array1_int4 parm.6;

    parm.6.dtype = 265;
    parm.6.dim[0].lbound = 1;
    parm.6.dim[0].ubound = 2;
    parm.6.dim[0].stride = 1;
    parm.6.data = (int4[0:] *) (int4[0:] *) &i[0];
    parm.6.offset = 0;
    parm.7.dtype = 266;
    parm.7.dim[0].lbound = 1;
    parm.7.dim[0].ubound = 2;
    parm.7.dim[0].stride = 1;
    parm.7.dim[1].lbound = 1;
    parm.7.dim[1].ubound = 2;
    parm.7.dim[1].stride = 2;
    parm.7.data = (int4[0:] *) (int4[0:] *) &n[0];
    parm.7.offset = 0;
    _gfortran_mmaxloc0_4_i4 (&parm.6, &parm.7, &C.502);
                                               ^^^^^^^
  }
The last argument of the mmaxloc function is bogus
(it should be an array descriptor), so I'd classify
this as a minor bug.

Severity minor because a scalar .true. mask is not particularly
useful.
Comment 1 Thomas Koenig 2005-04-10 22:32:55 UTC
s/as a minor bug/as a frontend bug/

*sigh*
Comment 2 Andrew Pinski 2005-04-11 19:45:19 UTC
Confirmed.
Comment 3 Thomas Koenig 2006-02-25 14:26:14 UTC
*** Bug 26182 has been marked as a duplicate of this bug. ***
Comment 4 Thomas Koenig 2006-03-07 22:33:58 UTC
Created attachment 10987 [details]
partial patch

This is a partial proof-of-concept patch that only deals
with minloc.  The test should be fairly straightforward, though.
Comment 5 Thomas Koenig 2006-03-10 23:07:12 UTC
Created attachment 11019 [details]
More complete patch

Here's a more complete patch, which should do the Right Thing.
Comment 6 patchapp@dberlin.org 2006-03-15 03:05:34 UTC
Subject: Bug number PR 20935

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-03/msg00881.html
Comment 7 Thomas Koenig 2006-03-20 21:56:04 UTC
Subject: Bug 20935

Author: tkoenig
Date: Mon Mar 20 21:56:00 2006
New Revision: 112230

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=112230
Log:
2006-03-20  Thomas Koenig  <Thomas.Koenig@online.de>

	PR fortran/20935
	* iresolve.c (gfc_resolve_maxloc):   If mask is scalar,
	prefix the function name with an "s".  If the mask is scalar
	or if its kind is smaller than gfc_default_logical_kind,
	coerce it to default kind.
	(gfc_resolve_maxval):  Likewise.
	(gfc_resolve_minloc):  Likewise.
	(gfc_resolve_minval):  Likewise.
	(gfc_resolve_product):  Likewise.
	(gfc_resolve_sum):  Likewise.

2006-03-20  Thomas Koenig  <Thomas.Koenig@online.de>

	PR fortran/20935
	* m4/iforeach.m4:  Add SCALAR_FOREACH_FUNCTION macro.
	* m4/ifunction.m4:  Add SCALAR_ARRAY_FUNCTION macro.
	* m4/minloc0.m4:  Use SCALAR_FOREACH_FUNCTION.
	* m4/minloc1.m4:  Use SCALAR_ARRAY_FUNCTION.
	* m4/maxloc0.m4:  Use SCALAR_FOREACH_FUNCTION.
	* m4/maxloc1.m4:  Use SCALAR_ARRAY_FUNCTION.
	* m4/minval.m4:  Likewise.
	* m4/maxval.m4:  Likewise.
	* m4/product.m4:  Likewise.
	* m4/sum.m4:  Likewise.
	* minloc0_16_i16.c : Regenerated.
	* minloc0_16_i4.c : Regenerated.
	* minloc0_16_i8.c : Regenerated.
	* minloc0_16_r10.c : Regenerated.
	* minloc0_16_r16.c : Regenerated.
	* minloc0_16_r4.c : Regenerated.
	* minloc0_16_r8.c : Regenerated.
	* minloc0_4_i16.c : Regenerated.
	* minloc0_4_i4.c : Regenerated.
	* minloc0_4_i8.c : Regenerated.
	* minloc0_4_r10.c : Regenerated.
	* minloc0_4_r16.c : Regenerated.
	* minloc0_4_r4.c : Regenerated.
	* minloc0_4_r8.c : Regenerated.
	* minloc0_8_i16.c : Regenerated.
	* minloc0_8_i4.c : Regenerated.
	* minloc0_8_i8.c : Regenerated.
	* minloc0_8_r10.c : Regenerated.
	* minloc0_8_r16.c : Regenerated.
	* minloc0_8_r4.c : Regenerated.
	* minloc0_8_r8.c : Regenerated.
	* minloc1_16_i16.c : Regenerated.
	* minloc1_16_i4.c : Regenerated.
	* minloc1_16_i8.c : Regenerated.
	* minloc1_16_r10.c : Regenerated.
	* minloc1_16_r16.c : Regenerated.
	* minloc1_16_r4.c : Regenerated.
	* minloc1_16_r8.c : Regenerated.
	* minloc1_4_i16.c : Regenerated.
	* minloc1_4_i4.c : Regenerated.
	* minloc1_4_i8.c : Regenerated.
	* minloc1_4_r10.c : Regenerated.
	* minloc1_4_r16.c : Regenerated.
	* minloc1_4_r4.c : Regenerated.
	* minloc1_4_r8.c : Regenerated.
	* minloc1_8_i16.c : Regenerated.
	* minloc1_8_i4.c : Regenerated.
	* minloc1_8_i8.c : Regenerated.
	* minloc1_8_r10.c : Regenerated.
	* minloc1_8_r16.c : Regenerated.
	* minloc1_8_r4.c : Regenerated.
	* minloc1_8_r8.c : Regenerated.
	* maxloc0_16_i16.c : Regenerated.
	* maxloc0_16_i4.c : Regenerated.
	* maxloc0_16_i8.c : Regenerated.
	* maxloc0_16_r10.c : Regenerated.
	* maxloc0_16_r16.c : Regenerated.
	* maxloc0_16_r4.c : Regenerated.
	* maxloc0_16_r8.c : Regenerated.
	* maxloc0_4_i16.c : Regenerated.
	* maxloc0_4_i4.c : Regenerated.
	* maxloc0_4_i8.c : Regenerated.
	* maxloc0_4_r10.c : Regenerated.
	* maxloc0_4_r16.c : Regenerated.
	* maxloc0_4_r4.c : Regenerated.
	* maxloc0_4_r8.c : Regenerated.
	* maxloc0_8_i16.c : Regenerated.
	* maxloc0_8_i4.c : Regenerated.
	* maxloc0_8_i8.c : Regenerated.
	* maxloc0_8_r10.c : Regenerated.
	* maxloc0_8_r16.c : Regenerated.
	* maxloc0_8_r4.c : Regenerated.
	* maxloc0_8_r8.c : Regenerated.
	* maxloc1_16_i16.c : Regenerated.
	* maxloc1_16_i4.c : Regenerated.
	* maxloc1_16_i8.c : Regenerated.
	* maxloc1_16_r10.c : Regenerated.
	* maxloc1_16_r16.c : Regenerated.
	* maxloc1_16_r4.c : Regenerated.
	* maxloc1_16_r8.c : Regenerated.
	* maxloc1_4_i16.c : Regenerated.
	* maxloc1_4_i4.c : Regenerated.
	* maxloc1_4_i8.c : Regenerated.
	* maxloc1_4_r10.c : Regenerated.
	* maxloc1_4_r16.c : Regenerated.
	* maxloc1_4_r4.c : Regenerated.
	* maxloc1_4_r8.c : Regenerated.
	* maxloc1_8_i16.c : Regenerated.
	* maxloc1_8_i4.c : Regenerated.
	* maxloc1_8_i8.c : Regenerated.
	* maxloc1_8_r10.c : Regenerated.
	* maxloc1_8_r16.c : Regenerated.
	* maxloc1_8_r4.c : Regenerated.
	* maxloc1_8_r8.c : Regenerated.
	* maxval_i16.c : Regenerated.
	* maxval_i4.c : Regenerated.
	* maxval_i8.c : Regenerated.
	* maxval_r10.c : Regenerated.
	* maxval_r16.c : Regenerated.
	* maxval_r4.c : Regenerated.
	* maxval_r8.c : Regenerated.
	* minval_i16.c : Regenerated.
	* minval_i4.c : Regenerated.
	* minval_i8.c : Regenerated.
	* minval_r10.c : Regenerated.
	* minval_r16.c : Regenerated.
	* minval_r4.c : Regenerated.
	* minval_r8.c : Regenerated.
	* sum_c10.c : Regenerated.
	* sum_c16.c : Regenerated.
	* sum_c4.c : Regenerated.
	* sum_c8.c : Regenerated.
	* sum_i16.c : Regenerated.
	* sum_i4.c : Regenerated.
	* sum_i8.c : Regenerated.
	* sum_r10.c : Regenerated.
	* sum_r16.c : Regenerated.
	* sum_r4.c : Regenerated.
	* sum_r8.c : Regenerated.
	* product_c10.c : Regenerated.
	* product_c16.c : Regenerated.
	* product_c4.c : Regenerated.
	* product_c8.c : Regenerated.
	* product_i16.c : Regenerated.
	* product_i4.c : Regenerated.
	* product_i8.c : Regenerated.
	* product_r10.c : Regenerated.
	* product_r16.c : Regenerated.
	* product_r4.c : Regenerated.
	* product_r8.c : Regenerated.

2006-03-20  Thomas Koenig  <Thomas.Koenig@online.de>

	PR fortran/20935
	* gfortran.dg/scalar_mask_2.f90:  New test case.


Added:
    trunk/gcc/testsuite/gfortran.dg/scalar_mask_2.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/iresolve.c
    trunk/gcc/testsuite/ChangeLog
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/generated/maxloc0_16_i16.c
    trunk/libgfortran/generated/maxloc0_16_i4.c
    trunk/libgfortran/generated/maxloc0_16_i8.c
    trunk/libgfortran/generated/maxloc0_16_r10.c
    trunk/libgfortran/generated/maxloc0_16_r16.c
    trunk/libgfortran/generated/maxloc0_16_r4.c
    trunk/libgfortran/generated/maxloc0_16_r8.c
    trunk/libgfortran/generated/maxloc0_4_i16.c
    trunk/libgfortran/generated/maxloc0_4_i4.c
    trunk/libgfortran/generated/maxloc0_4_i8.c
    trunk/libgfortran/generated/maxloc0_4_r10.c
    trunk/libgfortran/generated/maxloc0_4_r16.c
    trunk/libgfortran/generated/maxloc0_4_r4.c
    trunk/libgfortran/generated/maxloc0_4_r8.c
    trunk/libgfortran/generated/maxloc0_8_i16.c
    trunk/libgfortran/generated/maxloc0_8_i4.c
    trunk/libgfortran/generated/maxloc0_8_i8.c
    trunk/libgfortran/generated/maxloc0_8_r10.c
    trunk/libgfortran/generated/maxloc0_8_r16.c
    trunk/libgfortran/generated/maxloc0_8_r4.c
    trunk/libgfortran/generated/maxloc0_8_r8.c
    trunk/libgfortran/generated/maxloc1_16_i16.c
    trunk/libgfortran/generated/maxloc1_16_i4.c
    trunk/libgfortran/generated/maxloc1_16_i8.c
    trunk/libgfortran/generated/maxloc1_16_r10.c
    trunk/libgfortran/generated/maxloc1_16_r16.c
    trunk/libgfortran/generated/maxloc1_16_r4.c
    trunk/libgfortran/generated/maxloc1_16_r8.c
    trunk/libgfortran/generated/maxloc1_4_i16.c
    trunk/libgfortran/generated/maxloc1_4_i4.c
    trunk/libgfortran/generated/maxloc1_4_i8.c
    trunk/libgfortran/generated/maxloc1_4_r10.c
    trunk/libgfortran/generated/maxloc1_4_r16.c
    trunk/libgfortran/generated/maxloc1_4_r4.c
    trunk/libgfortran/generated/maxloc1_4_r8.c
    trunk/libgfortran/generated/maxloc1_8_i16.c
    trunk/libgfortran/generated/maxloc1_8_i4.c
    trunk/libgfortran/generated/maxloc1_8_i8.c
    trunk/libgfortran/generated/maxloc1_8_r10.c
    trunk/libgfortran/generated/maxloc1_8_r16.c
    trunk/libgfortran/generated/maxloc1_8_r4.c
    trunk/libgfortran/generated/maxloc1_8_r8.c
    trunk/libgfortran/generated/maxval_i16.c
    trunk/libgfortran/generated/maxval_i4.c
    trunk/libgfortran/generated/maxval_i8.c
    trunk/libgfortran/generated/maxval_r10.c
    trunk/libgfortran/generated/maxval_r16.c
    trunk/libgfortran/generated/maxval_r4.c
    trunk/libgfortran/generated/maxval_r8.c
    trunk/libgfortran/generated/minloc0_16_i16.c
    trunk/libgfortran/generated/minloc0_16_i4.c
    trunk/libgfortran/generated/minloc0_16_i8.c
    trunk/libgfortran/generated/minloc0_16_r10.c
    trunk/libgfortran/generated/minloc0_16_r16.c
    trunk/libgfortran/generated/minloc0_16_r4.c
    trunk/libgfortran/generated/minloc0_16_r8.c
    trunk/libgfortran/generated/minloc0_4_i16.c
    trunk/libgfortran/generated/minloc0_4_i4.c
    trunk/libgfortran/generated/minloc0_4_i8.c
    trunk/libgfortran/generated/minloc0_4_r10.c
    trunk/libgfortran/generated/minloc0_4_r16.c
    trunk/libgfortran/generated/minloc0_4_r4.c
    trunk/libgfortran/generated/minloc0_4_r8.c
    trunk/libgfortran/generated/minloc0_8_i16.c
    trunk/libgfortran/generated/minloc0_8_i4.c
    trunk/libgfortran/generated/minloc0_8_i8.c
    trunk/libgfortran/generated/minloc0_8_r10.c
    trunk/libgfortran/generated/minloc0_8_r16.c
    trunk/libgfortran/generated/minloc0_8_r4.c
    trunk/libgfortran/generated/minloc0_8_r8.c
    trunk/libgfortran/generated/minloc1_16_i16.c
    trunk/libgfortran/generated/minloc1_16_i4.c
    trunk/libgfortran/generated/minloc1_16_i8.c
    trunk/libgfortran/generated/minloc1_16_r10.c
    trunk/libgfortran/generated/minloc1_16_r16.c
    trunk/libgfortran/generated/minloc1_16_r4.c
    trunk/libgfortran/generated/minloc1_16_r8.c
    trunk/libgfortran/generated/minloc1_4_i16.c
    trunk/libgfortran/generated/minloc1_4_i4.c
    trunk/libgfortran/generated/minloc1_4_i8.c
    trunk/libgfortran/generated/minloc1_4_r10.c
    trunk/libgfortran/generated/minloc1_4_r16.c
    trunk/libgfortran/generated/minloc1_4_r4.c
    trunk/libgfortran/generated/minloc1_4_r8.c
    trunk/libgfortran/generated/minloc1_8_i16.c
    trunk/libgfortran/generated/minloc1_8_i4.c
    trunk/libgfortran/generated/minloc1_8_i8.c
    trunk/libgfortran/generated/minloc1_8_r10.c
    trunk/libgfortran/generated/minloc1_8_r16.c
    trunk/libgfortran/generated/minloc1_8_r4.c
    trunk/libgfortran/generated/minloc1_8_r8.c
    trunk/libgfortran/generated/minval_i16.c
    trunk/libgfortran/generated/minval_i4.c
    trunk/libgfortran/generated/minval_i8.c
    trunk/libgfortran/generated/minval_r10.c
    trunk/libgfortran/generated/minval_r16.c
    trunk/libgfortran/generated/minval_r4.c
    trunk/libgfortran/generated/minval_r8.c
    trunk/libgfortran/generated/product_c10.c
    trunk/libgfortran/generated/product_c16.c
    trunk/libgfortran/generated/product_c4.c
    trunk/libgfortran/generated/product_c8.c
    trunk/libgfortran/generated/product_i16.c
    trunk/libgfortran/generated/product_i4.c
    trunk/libgfortran/generated/product_i8.c
    trunk/libgfortran/generated/product_r10.c
    trunk/libgfortran/generated/product_r16.c
    trunk/libgfortran/generated/product_r4.c
    trunk/libgfortran/generated/product_r8.c
    trunk/libgfortran/generated/sum_c10.c
    trunk/libgfortran/generated/sum_c16.c
    trunk/libgfortran/generated/sum_c4.c
    trunk/libgfortran/generated/sum_c8.c
    trunk/libgfortran/generated/sum_i16.c
    trunk/libgfortran/generated/sum_i4.c
    trunk/libgfortran/generated/sum_i8.c
    trunk/libgfortran/generated/sum_r10.c
    trunk/libgfortran/generated/sum_r16.c
    trunk/libgfortran/generated/sum_r4.c
    trunk/libgfortran/generated/sum_r8.c
    trunk/libgfortran/m4/iforeach.m4
    trunk/libgfortran/m4/ifunction.m4
    trunk/libgfortran/m4/maxloc0.m4
    trunk/libgfortran/m4/maxloc1.m4
    trunk/libgfortran/m4/maxval.m4
    trunk/libgfortran/m4/minloc0.m4
    trunk/libgfortran/m4/minloc1.m4
    trunk/libgfortran/m4/minval.m4
    trunk/libgfortran/m4/product.m4
    trunk/libgfortran/m4/sum.m4

Comment 8 Thomas Koenig 2006-03-27 20:05:34 UTC
Subject: Bug 20935

Author: tkoenig
Date: Mon Mar 27 20:05:24 2006
New Revision: 112425

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=112425
Log:
2006-03-27  Thomas Koenig  <Thomas.Koenig@online.de>

	PR fortran/20935
	Backport from mainline
	* m4/iforeach.m4:  Add SCALAR_FOREACH_FUNCTION macro.
	* m4/ifunction.m4:  Add SCALAR_ARRAY_FUNCTION macro.
	* m4/minloc0.m4:  Use SCALAR_FOREACH_FUNCTION.
	* m4/minloc1.m4:  Use SCALAR_ARRAY_FUNCTION.
	* m4/maxloc0.m4:  Use SCALAR_FOREACH_FUNCTION.
	* m4/maxloc1.m4:  Use SCALAR_ARRAY_FUNCTION.
	* m4/minval.m4:  Likewise.
	* m4/maxval.m4:  Likewise.
	* m4/product.m4:  Likewise.
	* m4/sum.m4:  Likewise.
	* minloc0_16_i16.c : Regenerated.
	* minloc0_16_i4.c : Regenerated.
	* minloc0_16_i8.c : Regenerated.
	* minloc0_16_r10.c : Regenerated.
	* minloc0_16_r16.c : Regenerated.
	* minloc0_16_r4.c : Regenerated.
	* minloc0_16_r8.c : Regenerated.
	* minloc0_4_i16.c : Regenerated.
	* minloc0_4_i4.c : Regenerated.
	* minloc0_4_i8.c : Regenerated.
	* minloc0_4_r10.c : Regenerated.
	* minloc0_4_r16.c : Regenerated.
	* minloc0_4_r4.c : Regenerated.
	* minloc0_4_r8.c : Regenerated.
	* minloc0_8_i16.c : Regenerated.
	* minloc0_8_i4.c : Regenerated.
	* minloc0_8_i8.c : Regenerated.
	* minloc0_8_r10.c : Regenerated.
	* minloc0_8_r16.c : Regenerated.
	* minloc0_8_r4.c : Regenerated.
	* minloc0_8_r8.c : Regenerated.
	* minloc1_16_i16.c : Regenerated.
	* minloc1_16_i4.c : Regenerated.
	* minloc1_16_i8.c : Regenerated.
	* minloc1_16_r10.c : Regenerated.
	* minloc1_16_r16.c : Regenerated.
	* minloc1_16_r4.c : Regenerated.
	* minloc1_16_r8.c : Regenerated.
	* minloc1_4_i16.c : Regenerated.
	* minloc1_4_i4.c : Regenerated.
	* minloc1_4_i8.c : Regenerated.
	* minloc1_4_r10.c : Regenerated.
	* minloc1_4_r16.c : Regenerated.
	* minloc1_4_r4.c : Regenerated.
	* minloc1_4_r8.c : Regenerated.
	* minloc1_8_i16.c : Regenerated.
	* minloc1_8_i4.c : Regenerated.
	* minloc1_8_i8.c : Regenerated.
	* minloc1_8_r10.c : Regenerated.
	* minloc1_8_r16.c : Regenerated.
	* minloc1_8_r4.c : Regenerated.
	* minloc1_8_r8.c : Regenerated.
	* maxloc0_16_i16.c : Regenerated.
	* maxloc0_16_i4.c : Regenerated.
	* maxloc0_16_i8.c : Regenerated.
	* maxloc0_16_r10.c : Regenerated.
	* maxloc0_16_r16.c : Regenerated.
	* maxloc0_16_r4.c : Regenerated.
	* maxloc0_16_r8.c : Regenerated.
	* maxloc0_4_i16.c : Regenerated.
	* maxloc0_4_i4.c : Regenerated.
	* maxloc0_4_i8.c : Regenerated.
	* maxloc0_4_r10.c : Regenerated.
	* maxloc0_4_r16.c : Regenerated.
	* maxloc0_4_r4.c : Regenerated.
	* maxloc0_4_r8.c : Regenerated.
	* maxloc0_8_i16.c : Regenerated.
	* maxloc0_8_i4.c : Regenerated.
	* maxloc0_8_i8.c : Regenerated.
	* maxloc0_8_r10.c : Regenerated.
	* maxloc0_8_r16.c : Regenerated.
	* maxloc0_8_r4.c : Regenerated.
	* maxloc0_8_r8.c : Regenerated.
	* maxloc1_16_i16.c : Regenerated.
	* maxloc1_16_i4.c : Regenerated.
	* maxloc1_16_i8.c : Regenerated.
	* maxloc1_16_r10.c : Regenerated.
	* maxloc1_16_r16.c : Regenerated.
	* maxloc1_16_r4.c : Regenerated.
	* maxloc1_16_r8.c : Regenerated.
	* maxloc1_4_i16.c : Regenerated.
	* maxloc1_4_i4.c : Regenerated.
	* maxloc1_4_i8.c : Regenerated.
	* maxloc1_4_r10.c : Regenerated.
	* maxloc1_4_r16.c : Regenerated.
	* maxloc1_4_r4.c : Regenerated.
	* maxloc1_4_r8.c : Regenerated.
	* maxloc1_8_i16.c : Regenerated.
	* maxloc1_8_i4.c : Regenerated.
	* maxloc1_8_i8.c : Regenerated.
	* maxloc1_8_r10.c : Regenerated.
	* maxloc1_8_r16.c : Regenerated.
	* maxloc1_8_r4.c : Regenerated.
	* maxloc1_8_r8.c : Regenerated.
	* maxval_i16.c : Regenerated.
	* maxval_i4.c : Regenerated.
	* maxval_i8.c : Regenerated.
	* maxval_r10.c : Regenerated.
	* maxval_r16.c : Regenerated.
	* maxval_r4.c : Regenerated.
	* maxval_r8.c : Regenerated.
	* minval_i16.c : Regenerated.
	* minval_i4.c : Regenerated.
	* minval_i8.c : Regenerated.
	* minval_r10.c : Regenerated.
	* minval_r16.c : Regenerated.
	* minval_r4.c : Regenerated.
	* minval_r8.c : Regenerated.
	* sum_c10.c : Regenerated.
	* sum_c16.c : Regenerated.
	* sum_c4.c : Regenerated.
	* sum_c8.c : Regenerated.
	* sum_i16.c : Regenerated.
	* sum_i4.c : Regenerated.
	* sum_i8.c : Regenerated.
	* sum_r10.c : Regenerated.
	* sum_r16.c : Regenerated.
	* sum_r4.c : Regenerated.
	* sum_r8.c : Regenerated.
	* product_c10.c : Regenerated.
	* product_c16.c : Regenerated.
	* product_c4.c : Regenerated.
	* product_c8.c : Regenerated.
	* product_i16.c : Regenerated.
	* product_i4.c : Regenerated.
	* product_i8.c : Regenerated.
	* product_r10.c : Regenerated.
	* product_r16.c : Regenerated.
	* product_r4.c : Regenerated.
	* product_r8.c : Regenerated.

2006-03-27  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/25378
	Backport from mainline
	* 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-27  Thomas Koenig  <Thomas.Koenig@online.de>

	PR fortran/20935
	Backport from mainline
	* iresolve.c (gfc_resolve_maxloc):   If mask is scalar,
	prefix the function name with an "s".  If the mask is scalar
	or if its kind is smaller than gfc_default_logical_kind,
	coerce it to default kind.
	(gfc_resolve_maxval):  Likewise.
	(gfc_resolve_minloc):  Likewise.
	(gfc_resolve_minval):  Likewise.
	(gfc_resolve_product):  Likewise.
	(gfc_resolve_sum):  Likewise.

2006-03-27  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/25378
	Backport from mainline
	* 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-27  Thomas Koenig  <Thomas.Koenig@online.de>

	PR fortran/20935
	Backport from mainline
	* gfortran.dg/scalar_mask_2.f90:  New test case.

2006-03-27  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/25378
	Backport from mainline
	* 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.


Added:
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/scalar_mask_2.f90
Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/iresolve.c
    branches/gcc-4_1-branch/gcc/fortran/trans-intrinsic.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/scalar_mask_1.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_mmloc_3.f90
    branches/gcc-4_1-branch/libgfortran/ChangeLog
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_16_i16.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_16_i4.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_16_i8.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_16_r10.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_16_r16.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_16_r4.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_16_r8.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_4_i16.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_4_i4.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_4_i8.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_4_r10.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_4_r16.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_4_r4.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_4_r8.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_8_i16.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_8_i4.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_8_i8.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_8_r10.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_8_r16.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_8_r4.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc0_8_r8.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_16_i16.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_16_i4.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_16_i8.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_16_r10.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_16_r16.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_16_r4.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_16_r8.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_4_i16.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_4_i4.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_4_i8.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_4_r10.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_4_r16.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_4_r4.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_4_r8.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_8_i16.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_8_i4.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_8_i8.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_8_r10.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_8_r16.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_8_r4.c
    branches/gcc-4_1-branch/libgfortran/generated/maxloc1_8_r8.c
    branches/gcc-4_1-branch/libgfortran/generated/maxval_i16.c
    branches/gcc-4_1-branch/libgfortran/generated/maxval_i4.c
    branches/gcc-4_1-branch/libgfortran/generated/maxval_i8.c
    branches/gcc-4_1-branch/libgfortran/generated/maxval_r10.c
    branches/gcc-4_1-branch/libgfortran/generated/maxval_r16.c
    branches/gcc-4_1-branch/libgfortran/generated/maxval_r4.c
    branches/gcc-4_1-branch/libgfortran/generated/maxval_r8.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_16_i16.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_16_i4.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_16_i8.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_16_r10.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_16_r16.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_16_r4.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_16_r8.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_4_i16.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_4_i4.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_4_i8.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_4_r10.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_4_r16.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_4_r4.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_4_r8.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_8_i16.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_8_i4.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_8_i8.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_8_r10.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_8_r16.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_8_r4.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc0_8_r8.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_16_i16.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_16_i4.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_16_i8.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_16_r10.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_16_r16.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_16_r4.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_16_r8.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_4_i16.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_4_i4.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_4_i8.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_4_r10.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_4_r16.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_4_r4.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_4_r8.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_8_i16.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_8_i4.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_8_i8.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_8_r10.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_8_r16.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_8_r4.c
    branches/gcc-4_1-branch/libgfortran/generated/minloc1_8_r8.c
    branches/gcc-4_1-branch/libgfortran/generated/minval_i16.c
    branches/gcc-4_1-branch/libgfortran/generated/minval_i4.c
    branches/gcc-4_1-branch/libgfortran/generated/minval_i8.c
    branches/gcc-4_1-branch/libgfortran/generated/minval_r10.c
    branches/gcc-4_1-branch/libgfortran/generated/minval_r16.c
    branches/gcc-4_1-branch/libgfortran/generated/minval_r4.c
    branches/gcc-4_1-branch/libgfortran/generated/minval_r8.c
    branches/gcc-4_1-branch/libgfortran/generated/product_c10.c
    branches/gcc-4_1-branch/libgfortran/generated/product_c16.c
    branches/gcc-4_1-branch/libgfortran/generated/product_c4.c
    branches/gcc-4_1-branch/libgfortran/generated/product_c8.c
    branches/gcc-4_1-branch/libgfortran/generated/product_i16.c
    branches/gcc-4_1-branch/libgfortran/generated/product_i4.c
    branches/gcc-4_1-branch/libgfortran/generated/product_i8.c
    branches/gcc-4_1-branch/libgfortran/generated/product_r10.c
    branches/gcc-4_1-branch/libgfortran/generated/product_r16.c
    branches/gcc-4_1-branch/libgfortran/generated/product_r4.c
    branches/gcc-4_1-branch/libgfortran/generated/product_r8.c
    branches/gcc-4_1-branch/libgfortran/generated/sum_c10.c
    branches/gcc-4_1-branch/libgfortran/generated/sum_c16.c
    branches/gcc-4_1-branch/libgfortran/generated/sum_c4.c
    branches/gcc-4_1-branch/libgfortran/generated/sum_c8.c
    branches/gcc-4_1-branch/libgfortran/generated/sum_i16.c
    branches/gcc-4_1-branch/libgfortran/generated/sum_i4.c
    branches/gcc-4_1-branch/libgfortran/generated/sum_i8.c
    branches/gcc-4_1-branch/libgfortran/generated/sum_r10.c
    branches/gcc-4_1-branch/libgfortran/generated/sum_r16.c
    branches/gcc-4_1-branch/libgfortran/generated/sum_r4.c
    branches/gcc-4_1-branch/libgfortran/generated/sum_r8.c
    branches/gcc-4_1-branch/libgfortran/m4/iforeach.m4
    branches/gcc-4_1-branch/libgfortran/m4/ifunction.m4
    branches/gcc-4_1-branch/libgfortran/m4/maxloc0.m4
    branches/gcc-4_1-branch/libgfortran/m4/maxloc1.m4
    branches/gcc-4_1-branch/libgfortran/m4/maxval.m4
    branches/gcc-4_1-branch/libgfortran/m4/minloc0.m4
    branches/gcc-4_1-branch/libgfortran/m4/minloc1.m4
    branches/gcc-4_1-branch/libgfortran/m4/minval.m4
    branches/gcc-4_1-branch/libgfortran/m4/product.m4
    branches/gcc-4_1-branch/libgfortran/m4/sum.m4

Comment 9 Thomas Koenig 2006-03-29 19:29:57 UTC
Fixed on 4.1.  Closing.
Comment 10 Thomas Koenig 2006-03-29 19:30:24 UTC
Really closing.