summaryrefslogtreecommitdiff
path: root/gcc/cgraphclones.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-16 19:22:57 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-16 19:22:57 +0000
commit022a2340614efca272a538c27ddb40c2f193dc76 (patch)
tree12b6d76fc0f117c75866f01aa2c9dc3604966d54 /gcc/cgraphclones.c
parenta69f2cf8863c1ee70ea48deaf88bec82b3bc4f31 (diff)
downloadgcc-022a2340614efca272a538c27ddb40c2f193dc76.tar.gz
PR ipa/64963
* cgraphclones.c (cgraph_node::create_virtual_clone): Copy section if not linkonce. Fix up formatting. (cgraph_node::create_version_clone_with_body): Copy section. * trans-mem.c (ipa_tm_create_version): Likewise. * gcc.dg/ipa/ipa-clone-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220742 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraphclones.c')
-rw-r--r--gcc/cgraphclones.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c
index 2a7de2e6689..863081e2020 100644
--- a/gcc/cgraphclones.c
+++ b/gcc/cgraphclones.c
@@ -577,7 +577,7 @@ cgraph_node::create_virtual_clone (vec<cgraph_edge *> redirect_callers,
char *name;
if (!in_lto_p)
- gcc_checking_assert (tree_versionable_function_p (old_decl));
+ gcc_checking_assert (tree_versionable_function_p (old_decl));
gcc_assert (local.can_change_signature || !args_to_skip);
@@ -617,6 +617,8 @@ cgraph_node::create_virtual_clone (vec<cgraph_edge *> redirect_callers,
ABI support for this. */
set_new_clone_decl_and_node_flags (new_node);
new_node->clone.tree_map = tree_map;
+ if (!DECL_ONE_ONLY (old_decl))
+ new_node->set_section (get_section ());
/* Clones of global symbols or symbols with unique names are unique. */
if ((TREE_PUBLIC (old_decl)
@@ -1009,6 +1011,7 @@ cgraph_node::create_version_clone_with_body
new_version_node->externally_visible = 0;
new_version_node->local.local = 1;
new_version_node->lowered = true;
+ new_version_node->set_section (get_section ());
/* Clones of global symbols or symbols with unique names are unique. */
if ((TREE_PUBLIC (old_decl)
&& !DECL_EXTERNAL (old_decl)