From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 478D53858D33; Wed, 9 Aug 2023 10:08:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 478D53858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691575727; bh=ljUCp1vSqpnrRwxh9RTaWkmENQMfmsgc4JAuH9d6m1A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QuZUhMTM4K7NiASV2ZcAX8G15cfBDuvqMVJ2dk1DXyqzoDteOU4Q/gKQAySv9KySd +fNSlcQ2lglv4449mvi3vokQCSLB9n1dKR5a5sBrC1W6wxjueCETXGQdGJ/imUl0rm CTnOMLKcnDzpIaY92q8GKbqsoN4YWdkxwy6TMhFo= From: "trnka at scm dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/109684] compiling failure: complaining about a final subroutine of a type being not PURE (while it is indeed PURE) Date: Wed, 09 Aug 2023 10:08:45 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: trnka at scm dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: pault at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109684 --- Comment #17 from Tom=C3=A1=C5=A1 Trnka --- (In reply to kargl from comment #10) > diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc > index 3cd470ddcca..b0bb8bc1471 100644 > --- a/gcc/fortran/resolve.cc > +++ b/gcc/fortran/resolve.cc > @@ -17966,7 +17966,9 @@ resolve_types (gfc_namespace *ns) >=20=20 > for (n =3D ns->contained; n; n =3D n->sibling) > { > - if (gfc_pure (ns->proc_name) && !gfc_pure (n->proc_name)) > + if (gfc_pure (ns->proc_name) > + && !gfc_pure (n->proc_name) > + && !n->proc_name->attr.artificial) > gfc_error ("Contained procedure %qs at %L of a PURE procedure must " > "also be PURE", n->proc_name->name, > &n->proc_name->declared_at); >=20 > pault, dos the above look correct? On our codebase, this patch behaves just like the patch in comment #5, in t= hat it also triggers the issue described in comment #7 (assert in a warning abo= ut non-recursive procedures getting called recursively). Does either of you have any idea as to what that issue could be about? Or is isolating a testcase our only hope?=