From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B02703836C64; Tue, 2 Mar 2021 11:39:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B02703836C64 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/99326] [9/10/11 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299 Date: Tue, 02 Mar 2021 11:39:02 +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: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org 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: 9.4 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: Tue, 02 Mar 2021 11:39:02 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99326 --- Comment #2 from Tobias Burnus --- This looks very much like an error I looked at before. I think that was for 'select rank (y =3D> x)', which has the same issue as 'select type (y =3D> x)' or as this PR shows 'associate (y=3D>x)'. Additionally, the following points to the 'x' (gfc_current_location) and not to 'y'; we should save that location for the error message: 11 | associate (y =3D> x) | 1 Error: Assumed shape array at (1) must be a dummy argument That's something we should fix in match.c, where we have: if (gfc_match (" %n =3D>", newAssoc->name) !=3D MATCH_YES) ... if (gfc_match (" %e", &newAssoc->target)=20 ... newAssoc->where =3D gfc_current_locus; for associate but likewise for select type/rank. * * *=20 In resolve.c, there is: if (((as->type =3D=3D AS_ASSUMED_SIZE && !as->cp_was_assumed) || as->type =3D=3D AS_ASSUMED_SHAPE) && !sym->attr.dummy && !sym->attr.select_type_temporary) the latter is set for both select type + select rank. Looks as if we also n= eed a check like: sym->assoc or something like that. We probably should audit all code which uses select_type_temporary or sym->assoc to see whether we need to add a condition for associate or select type/rank there as well.=