From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AB5003858C5F; Mon, 3 Apr 2023 21:28:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB5003858C5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680557294; bh=QvoAwMt3N5yFV5Bz7fR9pJC9L0W6iRJyIKwpFblJblY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aIfFPzf4BEHxBc80lSO2E48b0O3CdeTpZ1OUmvgsSHSXJ2K72F2b84ZxW+urCElbH XcV/wd6fFjfvJuRu4DXxg72lJRHGvUqQDHHC4/qmcC06vwx9u3GILZ2r5TjYUTbY2j HkAORd02t9WJeJ3uzVIBKX+jZTqi9qr5VedcYKLE= From: "sgk at troutmask dot apl.washington.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/100607] ICE with SELECT RANK Date: Mon, 03 Apr 2023 21:28:14 +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: diagnostic 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100607 --- Comment #5 from Steve Kargl -= -- On Mon, Apr 03, 2023 at 08:16:20PM +0000, anlauf at gcc dot gnu.org wrote: > --- Comment #3 from anlauf at gcc dot gnu.org --- > (In reply to kargl from comment #2) > > Remove ice-on-invalid-code as I don't get an ICE. > >=20 > > The following patch suppresses the error message with the temporary var= iable > > and removes duplicated code. Please commit. > >=20 > > diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc > > index 46585879ddc..3462d43f346 100644 > > --- a/gcc/fortran/resolve.cc > > +++ b/gcc/fortran/resolve.cc > > @@ -9909,11 +9909,6 @@ resolve_select_rank (gfc_code *code, gfc_namespa= ce > > *old_ns) > > || gfc_expr_attr (code->expr1).pointer)) > > gfc_error ("RANK (*) at %L cannot be used with the pointer or " > > "allocatable selector at %L", &c->where, &code->expr1->where); > > - > > - if (case_value =3D=3D -1 && (gfc_expr_attr (code->expr1).allocat= able > > - || gfc_expr_attr (code->expr1).pointer)) > > - gfc_error ("RANK (*) at %L cannot be used with the pointer or " > > - "allocatable selector at %L", &c->where, &code->expr1->where); > > } > >=20=20 > > /* Add EXEC_SELECT to switch on rank. */ >=20 > This is a gem: not dead code, but un-dead code ... ;-) >=20 What I haven't concluded yet is if the code was copied with the intention to edit for another error condition, e.g., "case_value =3D=3D -2" or check on code->expr2.=