From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BD215398D046; Fri, 9 Apr 2021 13:03:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD215398D046 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/99857] [11 Regression] FAIL: libgomp.c/declare-variant-1.c (test for excess errors) by r11-7926 Date: Fri, 09 Apr 2021 13:03:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: hubicka 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: Fri, 09 Apr 2021 13:03:38 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99857 --- Comment #7 from Jakub Jelinek --- (In reply to Jan Hubicka from comment #6) > Thanks for a testcase, it makes things easier to debug indeed :) > The problem is that openmp uses declare_vairant_alt on symbols to make th= em > special definitions, but the definition flag is not set. That makes > free_lang_data to call release_body and since the code depends on referen= ces > things gets out of sync. >=20 > I am testing. >=20 > diff --git a/gcc/tree.c b/gcc/tree.c > index 7c44c226a33..e4e74ac8afc 100644 > --- a/gcc/tree.c > +++ b/gcc/tree.c > @@ -5849,7 +5849,7 @@ free_lang_data_in_decl (tree decl, class > free_lang_data_d *fld) > if (!(node =3D cgraph_node::get (decl)) > || (!node->definition && !node->clones)) > { > - if (node) > + if (node && !node->declare_variant_alt) > node->release_body (); > else > { Or - || (!node->definition && !node->clones)) + || (!node->definition && !node->clones && !node->declare_variant_alt)) ?=