aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto/lto-partition.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/lto/lto-partition.cc')
-rw-r--r--gcc/lto/lto-partition.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/lto/lto-partition.cc b/gcc/lto/lto-partition.cc
index 062fd03..ebb9c3a 100644
--- a/gcc/lto/lto-partition.cc
+++ b/gcc/lto/lto-partition.cc
@@ -898,6 +898,11 @@ maybe_rewrite_identifier (const char *ptr)
}
copy[off] = valid;
}
+ if (copy)
+ {
+ match = IDENTIFIER_POINTER (get_identifier (copy));
+ free (copy);
+ }
return match;
#else
return ptr;
@@ -921,9 +926,7 @@ validize_symbol_for_target (symtab_node *node)
{
symtab->change_decl_assembler_name (decl, get_identifier (name2));
if (node->lto_file_data)
- lto_record_renamed_decl (node->lto_file_data, name,
- IDENTIFIER_POINTER
- (DECL_ASSEMBLER_NAME (decl)));
+ lto_record_renamed_decl (node->lto_file_data, name, name2);
}
}
@@ -936,12 +939,12 @@ static hash_map<const char *, unsigned> *lto_clone_numbers;
static bool
privatize_symbol_name_1 (symtab_node *node, tree decl)
{
- const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+ const char *name0 = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
- if (must_not_rename (node, name))
+ if (must_not_rename (node, name0))
return false;
- name = maybe_rewrite_identifier (name);
+ const char *name = maybe_rewrite_identifier (name0);
unsigned &clone_number = lto_clone_numbers->get_or_insert (name);
symtab->change_decl_assembler_name (decl,
clone_function_name (
@@ -949,7 +952,7 @@ privatize_symbol_name_1 (symtab_node *node, tree decl)
clone_number++;
if (node->lto_file_data)
- lto_record_renamed_decl (node->lto_file_data, name,
+ lto_record_renamed_decl (node->lto_file_data, name0,
IDENTIFIER_POINTER
(DECL_ASSEMBLER_NAME (decl)));