public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/PR107944-get_untransformed_body)] IPA: do not release body if still needed
@ 2022-12-01  9:15 Martin Liska
  0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2022-12-01  9:15 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5ae78942816cee60c71726104985d4d3ab5d8821

commit 5ae78942816cee60c71726104985d4d3ab5d8821
Author: Martin Liska <mliska@suse.cz>
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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-01  9:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01  9:15 [gcc(refs/users/marxin/heads/PR107944-get_untransformed_body)] IPA: do not release body if still needed Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).