From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 85C193858425; Thu, 1 Dec 2022 09:15:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 85C193858425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669886109; bh=b0NilBhm5kj7KIXXJbQdnPWAnqUiKL1sQQDPFsfEOfY=; h=From:To:Subject:Date:From; b=ddKYO1rJ3S8T0FC4eJkmQkVwpZfLJZihn4M5QIIY1kgcYPLjoXwm7W8wYUVulXaDs 0VI+IZ0VeHL//8sR0Ycqxq2a534tgISCzGVmYBHzlo54g2nRRpD0Hfqx2ETv1HWIK+ vSZjWkfTTqL48OBYTZIA8TIEZyr5r3zs7/xZgJDQ= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/marxin/heads/PR107944-get_untransformed_body)] IPA: do not release body if still needed X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/users/marxin/heads/PR107944-get_untransformed_body X-Git-Oldrev: 2c089640279614e34b8712bfb318a9d4fc8ac8fe X-Git-Newrev: 5ae78942816cee60c71726104985d4d3ab5d8821 Message-Id: <20221201091509.85C193858425@sourceware.org> Date: Thu, 1 Dec 2022 09:15:09 +0000 (GMT) List-Id: https://gcc.gnu.org/g:5ae78942816cee60c71726104985d4d3ab5d8821 commit 5ae78942816cee60c71726104985d4d3ab5d8821 Author: Martin Liska Date: Thu Dec 1 10:13:26 2022 +0100 IPA: do not release body if still needed 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. PR ipa/107944 gcc/ChangeLog: * cgraph.cc (cgraph_node::remove): Do not release body if a node is clone of another node. Diff: --- 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)