https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68566
--- Comment #13 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- (In reply to kargl from comment #12) > =================================================================== > --- check.c (revision 237855) > +++ check.c (working copy) > @@ -3820,7 +3820,7 @@ gfc_check_reshape (gfc_expr *source, gfc > if (!type_check (order, 3, BT_INTEGER)) > return false; > > - if (order->expr_type == EXPR_ARRAY) > + if (order->expr_type == EXPR_ARRAY && gfc_is_constant_expr (order)) > { > int i, order_size, dim, perm[GFC_MAX_DIMENSIONS]; > gfc_expr *e; I will commit this for you Steve after regtesting, Drop me an email if you plan to do so.