> > >
> > > Perhaps, bootstrap needs to set appropriate warning levels.
> > 
> > https://gcc.gnu.org/ml/gcc-regression/2015-11/msg00648.html
> > 
> 
> See 5 lines up.
> 

Committed.

Index: ChangeLog
===================================================================
--- ChangeLog   (revision 230709)
+++ ChangeLog   (working copy)
@@ -1,5 +1,10 @@
 2015-11-21  Steven G. Kargl  <ka...@gcc.gnu.org>
 
+       * simplify.c (gfc_simplify_cshift): Work around bootstrap issues
+       due to inappropriate warning options. 
+
+2015-11-21  Steven G. Kargl  <ka...@gcc.gnu.org>
+
        * simplify.c (gfc_simplify_cshift): Implement simplification of
        CSHIFT for rank=1 arrays.
        (gfc_simplify_spread): Remove a FIXME and add error condition.
Index: simplify.c
===================================================================
--- simplify.c  (revision 230709)
+++ simplify.c  (working copy)
@@ -1869,6 +1869,15 @@ gfc_simplify_cshift (gfc_expr *array, gf
   else
     {
       /* FIXME: Deal with rank > 1 arrays.  For now, don't leak memory.  */
+
+      /* GCC bootstrap is too stupid to realize that the above code for dm
+        is correct.  First, dim can be specified for a rank 1 array.  It is
+        not needed in this nor used here.  Second, the code is simply waiting
+        for someone to implement rank > 1 simplification.   For now, add a
+        pessimization to the code that has a zero valid reason to be here.  */
+      if (dm > array->rank)
+       gcc_unreachable ();
+
       gfc_free_expr (a);
     }
 
-- 
Steve

Reply via email to