This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, fortran] PR19015 - shape / rank mismatch in maxloc / minloc could be caught at compile time


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]