diff mbox

(Partial) Implementation of simplificaiton of CSHIFT

Message ID A5584B50-6B18-4C81-9E89-800F7CDDA761@lps.ens.fr
State New
Headers show

Commit Message

Dominique d'Humières Nov. 21, 2015, 8:22 p.m. UTC
‘dm’ is actually not used, the building problem is fixed by the patch (I did not rearrange the nested ‘if’s)


Dominique

Comments

Steve Kargl Nov. 21, 2015, 8:30 p.m. UTC | #1
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.
Dominique d'Humières Nov. 22, 2015, 8:51 a.m. UTC | #2
Hi Steve,

Compiling the attached code after revision r230710 gives the ICE

f951: internal compiler error: in gfc_simplify_cshift, at fortran/simplify.c:1823

while it compiled before.

TIA

Dominique
Steve Kargl Nov. 22, 2015, 4:21 p.m. UTC | #3
On Sun, Nov 22, 2015 at 09:51:09AM +0100, Dominique d'Humi??res wrote:
> 
> Compiling the attached code after revision r230710 gives the ICE
> 
> f951: internal compiler error: in gfc_simplify_cshift, at fortran/simplify.c:1823
> 
> while it compiled before.
> 

File a bug report, then fix rank > 2.
Dominique d'Humières Nov. 22, 2015, 6:06 p.m. UTC | #4
> Le 22 nov. 2015 à 17:21, Steve Kargl <sgk@troutmask.apl.washington.edu> a écrit :
> 
> On Sun, Nov 22, 2015 at 09:51:09AM +0100, Dominique d'Humi??res wrote:
>> 
>> Compiling the attached code after revision r230710 gives the ICE
>> 
>> f951: internal compiler error: in gfc_simplify_cshift, at fortran/simplify.c:1823
>> 
>> while it compiled before.
>> 
> File a bug report, then fix rank > 2.

Already done by H.J. Lu (pr68486), see also my comment 2.

Dominique

> 
> -- 
> Steve
diff mbox

Patch

--- ../_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.   */