summaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 7064e06bcec..925eafe0506 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -6923,7 +6923,7 @@ get_file_function_name (const char *type)
/* If we already have a name we know to be unique, just use that. */
if (first_global_object_name)
- p = first_global_object_name;
+ p = q = ASTRDUP (first_global_object_name);
/* If the target is handling the constructors/destructors, they
will be local to this file and the name is only necessary for
debugging purposes. */
@@ -6940,7 +6940,6 @@ get_file_function_name (const char *type)
else
p = file;
p = q = ASTRDUP (p);
- clean_symbol_name (q);
}
else
{
@@ -6959,7 +6958,6 @@ get_file_function_name (const char *type)
len = strlen (file);
q = (char *) alloca (9 * 2 + len + 1);
memcpy (q, file, len + 1);
- clean_symbol_name (q);
sprintf (q + len, "_%08X_%08X", crc32_string (0, name),
crc32_string (0, get_random_seed (false)));
@@ -6967,6 +6965,7 @@ get_file_function_name (const char *type)
p = q;
}
+ clean_symbol_name (q);
buf = (char *) alloca (sizeof (FILE_FUNCTION_FORMAT) + strlen (p)
+ strlen (type));