From patchwork Sat Apr 10 09:22:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1464604 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FHTzn6LWMz9sVt for ; Sat, 10 Apr 2021 19:22:28 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C26653AAAC35; Sat, 10 Apr 2021 09:22:22 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id 4220E3861969 for ; Sat, 10 Apr 2021 09:22:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4220E3861969 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=hubicka@kam.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 9E33E280FDB; Sat, 10 Apr 2021 11:22:14 +0200 (CEST) Date: Sat, 10 Apr 2021 11:22:14 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Do not release body of declare_variant_alt Message-ID: <20210410092214.GA23746@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-14.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, the libgomp.c/../libgomp.c-c++-common/task-detach-6.c introduced by my release_body refactoring turns out to be relatively funny interaction between free_leang_data and openmp clones production. Openmp creates special functions with declare_variant_alt which eventualy becomes real functions, but for time being they do not have gimple body set. This is done by setting cgraph_node flags declare_variant_alt=1 and defintion=0. This is not completely systematic since cgraph code assumes that non-definitions are external symbols and do not have any references/call edges while declare_variant_alt has references. It would be more systematic to make this also a definition. I plan to clean this up next stage1 and also add a verifier that non-definitions do not have references. Honza gcc/ChangeLog: 2021-04-10 Jan Hubicka PR lto/99857 * tree.c (free_lang_data_in_decl): Do not release body of declare_variant_alt. 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 = cgraph_node::get (decl)) || (!node->definition && !node->clones)) { - if (node) + if (node && !node->declare_variant_alt) node->release_body (); else {