From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 088D13858029; Wed, 1 Dec 2021 21:00:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 088D13858029 From: "sgk at troutmask dot apl.washington.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/103505] ICE in compare_bound_mpz_t, at fortran/resolve.c:4587 since r8-7594-g078c5aff5ed83e9c Date: Wed, 01 Dec 2021 21:00:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: sgk at troutmask dot apl.washington.edu X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2021 21:00:14 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103505 --- Comment #5 from Steve Kargl -= -- 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=3D103505 >=20 > --- 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; > >=20=20 > > + if ((*upper)->expr_type !=3D EXPR_CONSTANT) > > + gfc_simplify_expr (*upper,0); > > + > > if (((*upper)->expr_type =3D=3D EXPR_CONSTANT > > && (*upper)->ts.type !=3D BT_INTEGER) || > > ((*upper)->expr_type =3D=3D EXPR_FUNCTION >=20 > There's a second place where this needs to be inserted for > the real upper bound to fix e.g. >=20 > integer, parameter :: z(1:(2.)) =3D [4, 8] >=20 Ah yes. Good catch. Are you going to insert the 2 lines=20 lower int the file? If so, I think you can considered=20 the patch complete and reviewed.=