https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103505
--- Comment #5 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Wed, Dec 01, 2021 at 08:26:25PM +0000, anlauf at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103505 > > --- Comment #4 from anlauf at gcc dot gnu.org --- > (In reply to kargl from comment #2) > > diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c > > index 6552eaf3b0c..1b2f5b310a7 100644 > > --- a/gcc/fortran/array.c > > +++ b/gcc/fortran/array.c > > @@ -492,6 +492,9 @@ match_array_element_spec (gfc_array_spec *as) > > if (!gfc_expr_check_typed (*upper, gfc_current_ns, false)) > > return AS_UNKNOWN; > > > > + if ((*upper)->expr_type != EXPR_CONSTANT) > > + gfc_simplify_expr (*upper,0); > > + > > if (((*upper)->expr_type == EXPR_CONSTANT > > && (*upper)->ts.type != BT_INTEGER) || > > ((*upper)->expr_type == EXPR_FUNCTION > > There's a second place where this needs to be inserted for > the real upper bound to fix e.g. > > integer, parameter :: z(1:(2.)) = [4, 8] > Ah yes. Good catch. Are you going to insert the 2 lines lower int the file? If so, I think you can considered the patch complete and reviewed.