diff options
Diffstat (limited to 'gcc/fortran/iresolve.c')
-rw-r--r-- | gcc/fortran/iresolve.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c index a68e42e..cdc4ac1 100644 --- a/gcc/fortran/iresolve.c +++ b/gcc/fortran/iresolve.c @@ -590,7 +590,7 @@ gfc_resolve_cshift (gfc_expr *f, gfc_expr *array, gfc_expr *shift, if (dim != NULL) { - if (dim->expr_type != EXPR_CONSTANT) + if (dim->expr_type != EXPR_CONSTANT && dim->symtree->n.sym->attr.optional) { /* Mark this for later setting the type in gfc_conv_missing_dummy. */ dim->representation.length = shift->ts.kind; @@ -728,7 +728,7 @@ gfc_resolve_eoshift (gfc_expr *f, gfc_expr *array, gfc_expr *shift, if (dim != NULL) { - if (dim->expr_type != EXPR_CONSTANT) + if (dim->expr_type != EXPR_CONSTANT && dim->symtree->n.sym->attr.optional) { /* Mark this for later setting the type in gfc_conv_missing_dummy. */ dim->representation.length = shift->ts.kind; |