public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/backport-11)] ipa: make target_clone default decl local [PR101726]
@ 2021-08-16  8:24 Martin Liska
  0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2021-08-16  8:24 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:85b78f6c38bb357abb749fed81a1e7a589050461

commit 85b78f6c38bb357abb749fed81a1e7a589050461
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Aug 12 16:01:01 2021 +0200

    ipa: make target_clone default decl local [PR101726]
    
            PR ipa/101726
    
    gcc/ChangeLog:
    
            * multiple_target.c (create_dispatcher_calls): Make default
              function local only if it is a definition.

Diff:
---
 gcc/multiple_target.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/gcc/multiple_target.c b/gcc/multiple_target.c
index e4192657cef..6c0565880c5 100644
--- a/gcc/multiple_target.c
+++ b/gcc/multiple_target.c
@@ -170,17 +170,20 @@ create_dispatcher_calls (struct cgraph_node *node)
 				      clone_function_name_numbered (
 					  node->decl, "default"));
 
-  /* FIXME: copy of cgraph_node::make_local that should be cleaned up
-	    in next stage1.  */
-  node->make_decl_local ();
-  node->set_section (NULL);
-  node->set_comdat_group (NULL);
-  node->externally_visible = false;
-  node->forced_by_abi = false;
-  node->set_section (NULL);
-
-  DECL_ARTIFICIAL (node->decl) = 1;
-  node->force_output = true;
+  if (node->definition)
+    {
+      /* FIXME: copy of cgraph_node::make_local that should be cleaned up
+		in next stage1.  */
+      node->make_decl_local ();
+      node->set_section (NULL);
+      node->set_comdat_group (NULL);
+      node->externally_visible = false;
+      node->forced_by_abi = false;
+      node->set_section (NULL);
+
+      DECL_ARTIFICIAL (node->decl) = 1;
+      node->force_output = true;
+    }
 }
 
 /* Return length of attribute names string,


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

only message in thread, other threads:[~2021-08-16  8:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-16  8:24 [gcc(refs/users/marxin/heads/backport-11)] ipa: make target_clone default decl local [PR101726] 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).