From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CC4613858D37; Thu, 25 May 2023 18:34:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC4613858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685039662; bh=5OGPZeGCsLb48vtTJhD9fSmc+jw2W2ZVfA7QMzaBeUw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LmRWiEAL7QsNLQP0UvDO/xHw6cIBnsIERlyWOk4PZAy3REPVzNZSGmn3sR5xmd2mZ SS/HymebiWWDodOhyMIvml1YUD7PJ7zatKLzsj9czEwmpjITlIotwjtOPPb4NzvQdO R42n+R+RmDzSLbaSSlzpCMDuuFzxPquDPR9nWItM= 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: Thu, 25 May 2023 18:34:22 +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: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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 anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pault at gcc dot gnu.org --- Comment #6 from anlauf at gcc dot gnu.org --- (In reply to Rimvydas (RJ) from comment #5) > (In reply to anlauf from comment #4) > > Can you check if this works for you? >=20 > This patch allows to avoid issue on all other associate use cases (tried = on > gcc-13 branch). >=20 > However it is a bit suspicious that using variable name abbreviations (to > dig out arrays from deeply nested types) is enough to change how the > internal gfc_array_ref is populated. ICE was triggered only on patterns > involving first using abbreviated name indexed access (like k(1)) followed > by any operation involving whole array. I agree that this patch is a band-aid, possibly for some latent issue. The suspect patch may have affected the order of resolution. Note that replacing in the reduced testcase in comment#3: associate(k=3D>k_2d) by associate(k=3D>k_2d(:)) avoids the ICE and gives identical code for gcc-12 .. gcc-14. In fact, the array-spec seems properly set. I've added Paul in CC, who is more familiar with the associate construct.=