From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AE253398B8A3; Fri, 9 Apr 2021 12:45:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE253398B8A3 From: "hubicka 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 12:45:24 +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: hubicka 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 12:45:24 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99857 --- Comment #6 from Jan Hubicka --- Thanks for a testcase, it makes things easier to debug indeed :) The problem is that openmp uses declare_vairant_alt on symbols to make them special definitions, but the definition flag is not set. That makes free_lang_data to call release_body and since the code depends on references things gets out of sync. I am testing. 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_da= ta_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 { For next stage1 I think we want to set definition bit for them and remove a= ll the special cases of declare_vairant_alt that makes them to behave as definitions. We also want to add checking that !definition symbols are exte= nral symbols which is missed in the verifier.=