===================================================================
@@ -227,7 +227,8 @@
}
-/* Test that the expression is an constant array. */
+/* Test that the expression is an constant array, simplifying if
+ we are dealing with a parameter array. */
static bool
is_constant_array_expr (gfc_expr *e)
@@ -237,6 +238,10 @@
if (e == NULL)
return true;
+ if (e->expr_type == EXPR_VARIABLE && e->rank > 0
+ && e->symtree->n.sym->attr.flavor == FL_PARAMETER)
+ gfc_simplify_expr (e, 1);
+
if (e->expr_type != EXPR_ARRAY || !gfc_is_constant_expr (e))
return false;