This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR19015 - shape / rank mismatch in maxloc / minloc could be caught at compile time
- From: Thomas Koenig <Thomas dot Koenig at online dot de>
- To: Paul Thomas <paulthomas2 at wanadoo dot fr>
- Cc: "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>, patch <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 16 May 2006 21:30:06 +0200
- Subject: Re: [Patch, fortran] PR19015 - shape / rank mismatch in maxloc / minloc could be caught at compile time
- References: <4468E543.8000502@wanadoo.fr>
On Mon, May 15, 2006 at 10:32:03PM +0200, Paul Thomas wrote:
> 2006-05-15 Paul Thomas <pault@gcc.gnu.org>
>
> PR fortran/19015
> * iresolve.c (maxloc, minloc): If DIM is not present, pass the
> rank of ARRAY as the shape of the result. Otherwise, pass the
> shape of ARRAY, less the dimension DIM.
> (maxval, minval): The same, when DIM is present, otherwise no
> change.
This patch is OK.
Could you add
> + integer, dimension(1) :: i
> + n = reshape((/1, 2, 3, 4/), shape(n))
> + i = maxloc(n) ! { dg-error "different shape for Array assignment" }
i = maxloc(n,dim=1) ! { dg-error "different shape for Array assignment" }
> + print *,i
and remove the print statement?
Thanks a lot for all of these patches.
Thomas