From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 98FCD383E832; Sun, 21 Jun 2020 15:31:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98FCD383E832 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592753492; bh=GEkpnKNcueJGNywCBm/0Gt1UH8PTw2WaRSUx5ZZQXAA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=C9TWTkpJHy48/O5RtdxZx7SkRviVuaL2qAk8Shaw6SxGpU77vVBt+knWHdgrYRhBC LOdZEfe7UL7W95rkTfBgcduaga+BQLUJ0usHkwNjcfgiAiE2HYx1ddHSV8XP8PpygQ mlRV0ya0EWd9KGCoCi6ZmTLjuo4twIwWhDyRwiUY= From: "dominiq at lps dot ens.fr" 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: Sun, 21 Jun 2020 15:31:32 +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: dominiq at lps dot ens.fr 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: 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: Sun, 21 Jun 2020 15:31:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D50410 --- Comment #41 from Dominique d'Humieres --- In my working tree I had the following patch --- /opt/gcc/_clean-svn//gcc/fortran/trans-expr.c 2020-01-05 11:44:35.000000000 +0100 +++ /opt/gcc/work-cvs/gcc/fortran/trans-expr.c 2020-01-05 11:45:38.0000000= 00 +0100 @@ -8366,7 +8366,7 @@ gfc_trans_structure_assign (tree dest, g gfc_init_se (&se, NULL); 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. */ if (!c->expr && !cm->attr.allocatable) @@ -8447,6 +8447,7 @@ gfc_trans_structure_assign (tree dest, g expr->ts.u.derived, init); gfc_add_expr_to_block (&block, tmp); } + gcc_assert (!c); return gfc_finish_block (&block); } @@ -8519,7 +8520,7 @@ gfc_conv_structure (gfc_se * se, gfc_exp 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 @@ -8564,6 +8565,11 @@ gfc_conv_structure (gfc_se * se, gfc_exp CONSTRUCTOR_APPEND_ELT (v, cm->backend_decl, val); } } + /* gcc_assert (!c); */ + if (c) + /* gfc_error ("Invalid DATA statement at %C."); + gfc_error ("Invalid DATA statement at %L.", &expr->where); */ + gfc_error ("Invalid DATA statement at %L.", &gfc_current_locus); se->expr =3D build_constructor (type, v); if (init) I have never seen the first assert triggering and I never found a way to em= it a better error message.=