From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3AA863893671; Sat, 20 Jun 2020 19:29:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3AA863893671 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592681343; bh=hI6OiYx/ghJGys76WqD59EC3VLTAyMfgHRhWk12QlBU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qDErMoWvsP1Y+EFKv6N6Asfv6qaGfPEpOltH9LA+mZvBYkN4E9x4a0F+eZP3fYVNd ptxhVmsD6pE5Hri2AbA0dg04M0HylQrT4kDDCNm531kHUH7xrKJmTFpy5ZHtCYzt5Q 6g1tWqVcy20VVIVgquC0kCeP5sjPczxHGEB+/brY= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/50410] [8/9/10/11 Regression] ICE in record_reference, pointer variable in data statement Date: Sat, 20 Jun 2020 19:29: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: 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.0 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 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: Sat, 20 Jun 2020 19:29:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D50410 anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gcc dot gnu.org --- Comment #40 from anlauf at gcc dot gnu.org --- (In reply to kargl from comment #39) > The bug is not fixed. The code from comment #3 >=20 > % cat a.f90 > type t > integer g > end type > type(t) :: u=3Dt(1) > data u%g /2/ > end The patch diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index b7c568e90e6..02caf992dfd 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -8543,7 +8543,7 @@ gfc_conv_structure (gfc_se * se, gfc_expr * expr, int init) cm =3D expr->ts.u.derived->components; for (c =3D gfc_constructor_first (expr->value.constructor); - c; c =3D gfc_constructor_next (c), cm =3D cm->next) + c && cm; c =3D gfc_constructor_next (c), cm =3D cm->next) { /* Skip absent members in default initializers and allocatable components. Although the latter have a default initializer fixes the ICE, but does not detect the double initialization. > The code in the first example in comment #9 also causes an ICE. This one then works and produces the expected error. > Codes z1.f90, z2.f90, and z3.f90 in comment #23 cause ICEs. Only z1 ICEs, z2 and z3 produce error messages.=