]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ipa: make target_clone default decl local [PR101726]
authorMartin Liska <mliska@suse.cz>
Thu, 12 Aug 2021 14:01:01 +0000 (16:01 +0200)
committerMartin Liska <mliska@suse.cz>
Mon, 16 Aug 2021 07:53:41 +0000 (09:53 +0200)
PR ipa/101726

gcc/ChangeLog:

* multiple_target.c (create_dispatcher_calls): Make default
  function local only if it is a definition.

gcc/multiple_target.c

index e4192657cef26ff6bc589e61e55c9c8281cebdd3..6c0565880c58c444c633fa398f96f17151a6014e 100644 (file)
@@ -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,