From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2795E3858C66; Mon, 31 Jul 2023 20:49:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2795E3858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690836563; bh=z6MQQDqR0/k5tPUzDZ6iPNyCyClrzpP8qFjOZc04Tfk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=A4O4BppxWswMwpDVaOjT4PLZR2G/NfZtV50EVxFR9b5oLfI5kzljj0lKS363pPA7m 52V5jHCScaTu2477qEcQwxlal9ldoaL8Ke4guCATbv1iHnN2h6tiiVm10Pu/IVVLFt HPKPOXXv1Fpx8zMTL5LXdbJN4TvH8aMAlC1wLGpk= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/50410] [11/12/13/14 Regression] ICE in record_reference, pointer variable in data statement Date: Mon, 31 Jul 2023 20:49:21 +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: 7.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created 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=3D50410 --- Comment #48 from anlauf at gcc dot gnu.org --- Created attachment 55666 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D55666&action=3Dedit Inremental patch This is a cut-down and revised version of the patch by Tobias that deals wi= th invalid allocatable and pointer components in data statements, and adjusted to F2018, and fixing the issue mentioned by Steve. I've removed the other part that tries to detect the double initialization. I think this is the wrong place as is would not detect e.g. the following: program p type t integer :: g end type t type(t) :: u data u /t(3)/ data u%g /2/ end A better-suited place is probably the loop in gfc_assign_data_value, but find_con_by_component seems not to be able to handle the current situation.=