From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3E9C83858421; Thu, 1 Jun 2023 18:20:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3E9C83858421 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685643635; bh=v+h9kv4CmOgOoz/Ke2eGgC4Nh54qLHWmJSBT2i1Bfvc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hBAc2ZxiZ8w2H916c5h5rRu3t8YR6Cd3eg26o/v6zbcvY9ShMbFnOxXM0TUVzapUU W8B1ZuBQTAfex4p+ajQnJHpvPQHeTEiq/N0dgrK69fYD3NQXoISQASQNNMjobMW5gL 5tPcdMUWoykemu/qMRQ5wt+g04UQ0sIWb+nOk0RE= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/110076] ICE on mutually recursive derived types. Date: Thu, 01 Jun 2023 18:20:34 +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: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed 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=3D110076 anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2023-06-01 Ever confirmed|0 |1 --- Comment #1 from anlauf at gcc dot gnu.org --- Confirmed. I believe I've seen another duplicate where running under gdb shows that we enter an infinite loop in gfc_get_derived_type: (gdb) l 2731,2753 2731 /* Go through the derived type components, building them as 2732 necessary. The reason for doing this now is that it is 2733 possible to recurse back to this derived type through a 2734 pointer component (PR24092). If this happens, the fields 2735 will be built and so we can return the type. */ 2736 for (c =3D derived->components; c; c =3D c->next) 2737 { 2738 bool same_alloc_type =3D c->attr.allocatable 2739 && derived =3D=3D c->ts.u.derived; 2740 2741 if (c->ts.type =3D=3D BT_UNION && c->ts.u.derived->backend_de= cl =3D=3D NULL) 2742 c->ts.u.derived->backend_decl =3D gfc_get_union_type (c->ts.u.derived); 2743 2744 if (c->ts.type !=3D BT_DERIVED && c->ts.type !=3D BT_CLASS) 2745 continue; 2746 2747 if ((!c->attr.pointer && !c->attr.proc_pointer 2748 && !same_alloc_type) 2749 || c->ts.u.derived->backend_decl =3D=3D NULL) 2750 { 2751 int local_codim =3D c->attr.codimension ? c->as->corank: codimen; 2752 c->ts.u.derived->backend_decl =3D gfc_get_derived_type (c->ts.u.derived, 2753=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 local_codim);=