public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] IPA: do not release body if still needed
@ 2022-12-01  9:59 Martin Liška
  2022-12-09  8:28 ` Martin Liška
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Martin Liška @ 2022-12-01  9:59 UTC (permalink / raw)
  To: gcc-patches; +Cc: Martin Jambor

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)
-- 
2.38.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-01-19 17:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01  9:59 [PATCH] IPA: do not release body if still needed Martin Liška
2022-12-09  8:28 ` Martin Liška
2022-12-28  9:20   ` Martin Liška
2023-01-13 16:49 ` Martin Jambor
2023-01-14 21:36 ` Jan Hubicka
2023-01-16 12:31   ` Martin Liška
2023-01-18 14:35     ` Martin Jambor
2023-01-18 15:33       ` Jan Hubicka
2023-01-19 17:41         ` Martin Jambor

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).