aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/mangle.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r--gcc/cp/mangle.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 69fe147..7c907b8 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -3503,12 +3503,17 @@ mangle_guard_variable (const tree variable)
initialize a static reference. This isn't part of the ABI, but we might
as well call them something readable. */
+static GTY(()) int temp_count;
+
tree
mangle_ref_init_variable (const tree variable)
{
start_mangling (variable);
write_string ("_ZGR");
write_name (variable, /*ignore_local_scope=*/0);
+ /* Avoid name clashes with aggregate initialization of multiple
+ references at once. */
+ write_unsigned_number (temp_count++);
return finish_mangling_get_identifier (/*warn=*/false);
}