From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4C56C3858C60; Wed, 31 May 2023 18:39:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C56C3858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685558341; bh=gFJhcJKjpUUQYAU1gTauTmiowI6eYqaMZOEPpiW4Isk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Eg+fUXzPk96pKeYhR0BkPOZA/HMnWy5ScvTuGp5yL8IBkZihDUIEuw8DxMFecymRU 7YRh34jvnhwWCfI7cze0ZMLgTnj2NcKdwAHhdHvKN7lR93ckJVVorUWDPTZ2mQbecy ts1/3IxP18czYbH/NZEUB7Kc99/ffriCgan1arPg= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/109948] [13/14 Regression] ICE(segfault) in gfc_expression_rank() from gfc_op_rank_conformable() Date: Wed, 31 May 2023 18:39:01 +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: 13.1.1 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: pault at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.2 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=3D109948 --- Comment #16 from anlauf at gcc dot gnu.org --- (In reply to Paul Thomas from comment #15) > Created attachment 55225 [details] > Fix for this PR >=20 > The attached patch substantially tidies up parse_associate and fixes: LGTM! I was close to proposing a hack for gfc_expression_rank that checks whether the variable's select_type_temporary, select_rank_temporary and associate_var attributes to decide which ref to evaluate. But your patch seems to be a much better approach. BTW: after your patch, the attribute assoc->rankguessed is no longer set. It is tested in two locations in resolve_assoc_var(resolve.cc), where it might be removed after your fix.=