[PATCH] (Partial) Implementation of simplificaiton of CSHIFT

Steve Kargl sgk@troutmask.apl.washington.edu
Sat Nov 21 21:50:00 GMT 2015


On Sat, Nov 21, 2015 at 09:22:40PM +0100, Dominique d'Humi??res wrote:
> ???dm??? is actually not used, the building problem is fixed by the patch (I did not rearrange the nested ???if???s)
> 
> --- ../_clean/gcc/fortran/simplify.c	2015-11-21 20:59:57.000000000 +0100
> +++ gcc/fortran/simplify.c	2015-11-21 21:06:30.000000000 +0100
> @@ -1792,7 +1792,6 @@ gfc_expr *
>  gfc_simplify_cshift (gfc_expr *array, gfc_expr *shift, gfc_expr *dim)
>  {
>    gfc_expr *a, *result;
> -  int dm;
>  
>    /* DIM is only useful for rank > 1, but deal with it here as one can
>       set DIM = 1 for rank = 1.  */
> @@ -1800,10 +1799,7 @@ gfc_simplify_cshift (gfc_expr *array, gf
>      {
>        if (!gfc_is_constant_expr (dim))
>  	return NULL;
> -      dm = mpz_get_si (dim->value.integer);
>      }
> -  else
> -    dm = 1;
>  
>    /* Copy array into 'a', simplify it, and then test for a constant array.
>       An unexpected expr_type causes an ICE.   */
> 

I already fix the problem.

Your patch unfixes the valid code that is needed for the rank>2 case.

-- 
Steve



More information about the Gcc-patches mailing list