From patchwork Thu Dec 1 09:59:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 28282 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp171251wrr; Thu, 1 Dec 2022 01:59:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf7VP9TbQNlF0xoX7/2uj0qFnIe5H44g3vkw+kta7HRkAXeGs8bv6eG9T6Lc1s4dWqihSxGc X-Received: by 2002:a17:907:c016:b0:7a4:98cc:7c8e with SMTP id ss22-20020a170907c01600b007a498cc7c8emr45420010ejc.48.1669888777179; Thu, 01 Dec 2022 01:59:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669888777; cv=none; d=google.com; s=arc-20160816; b=qx6evpH47LGnet3YddN6Iv5pOnM2mySlA2iePOvIOp/XMmoHxgaPPCnS3rt481geK+ KlX1ndOSHdhpG6Nw6N6ycVz92zWVHBrOYCYRs0KuXI8/HD/clyoY/huuAo6lz10u/Jl7 +I0+s0+wBw6S+DWCgq7P/orAov31TwZBKZVqWPZU+7uuNdRIJPxD0ud2vOv/y+jyQZI/ 41JmyaVZiRBr/4+KZLJK9R8OGnlpbCKMNHNZNExbZ1I3TXPeCrQyNB53VODvoUM/CNB/ I0ZYIMZku+dUcA7AgMJCPOqky38/872Unnftvdawhiy1Bj9rGc1W4U5UW66Uv4rmLNeD WIoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding:cc :content-language:to:subject:from:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature:dmarc-filter:delivered-to; bh=rnao0Mvqu/X21Jt381uphZoQCH7Tn0dP5UXkgMf9VYU=; b=J3meWoQXz0rYU5400W39IKZAPqotscr0dmchOl0BEmhgNf77Bexii8eFnPG4keQ/ez Mqz6TWRgpLjHvd6AAHD+ENJoYo7h+GU1gCpOGJIhj+zyszyxGn0b86uMoVyPhrKW80bS e0W8ccH8gmPZFkKk7+3TywHCE+f9z7Wf/Fr8qfZepwwS0qmUmxHOXw54G7lEocCMx7qD Mr5sH084Cmt2IihSDK6tg8Qws3Hc8u550zD2IOgiHBvWnJ4RgmD5PSJj4uTNgYSETFYS CC3yoyUug2Rf6/3p9a+ikKxdVvmfq6HDCudBzXldObE7HJ5rcXth+3+Y91fSkuMEJEnF Ge5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=b9BLZw18; dkim=neutral (no key) header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id hp12-20020a1709073e0c00b007c07f7713d7si4098972ejc.99.2022.12.01.01.59.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 01:59:37 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=b9BLZw18; dkim=neutral (no key) header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DFB1238582A3 for ; Thu, 1 Dec 2022 09:59:33 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id D3E463858D3C for ; Thu, 1 Dec 2022 09:59:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D3E463858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 8DB961FD68; Thu, 1 Dec 2022 09:59:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1669888748; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rnao0Mvqu/X21Jt381uphZoQCH7Tn0dP5UXkgMf9VYU=; b=b9BLZw18eBt5Pel1OmLM6doRUCLqsoBEuotF2KzuDW+8Qxn3YDbFw3S1xnta7+XgzUu3gn rbX9T5d38n5sTKAFhyHxKUQ8YjlVCAEBYFqALOeqQMCaL+bOf3rDdQ2rNyldlPIyPTWfSE ZGzpYzgAwDfhHnwzUQ94XHE9Xdqzisg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1669888748; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rnao0Mvqu/X21Jt381uphZoQCH7Tn0dP5UXkgMf9VYU=; b=6Ku8Mla48i6UOQfx8d/P/+Tg5zKQitM8HLedR5x2crqEtJ7wXCL/DX73ilhoZckUbsHnss CcjZy8TXvFqYxVBg== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 6C1241320E; Thu, 1 Dec 2022 09:59:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id 3YBaGex6iGMBHQAAGKfGzw (envelope-from ); Thu, 01 Dec 2022 09:59:08 +0000 Message-ID: Date: Thu, 1 Dec 2022 10:59:07 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] IPA: do not release body if still needed To: gcc-patches@gcc.gnu.org Content-Language: en-US Cc: Martin Jambor X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751005294222554462?= X-GMAIL-MSGID: =?utf-8?q?1751005294222554462?= Hi. Noticed during building of libbackend.a with the LTO partial linking. The function release_body is called even if clone_of is a clone of a another function and thus it shares tree declaration. We should preserve it in that situation. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin PR ipa/107944 gcc/ChangeLog: * cgraph.cc (cgraph_node::remove): Do not release body if a node is clone of another node. --- gcc/cgraph.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc index f15cb47c8b8..2e7d77ffd6c 100644 --- a/gcc/cgraph.cc +++ b/gcc/cgraph.cc @@ -1893,7 +1893,7 @@ cgraph_node::remove (void) else if (clone_of) { clone_of->clones = next_sibling_clone; - if (!clone_of->analyzed && !clone_of->clones && !clones) + if (!clone_of->analyzed && !clone_of->clones && !clones && !clone_of->clone_of) clone_of->release_body (); } if (next_sibling_clone)