aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index d767125..072519c 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -11115,7 +11115,22 @@ cxx_comdat_group (tree decl)
/* For all other DECLs, the COMDAT group is the mangled name of the
declaration itself. */
else
- name = DECL_ASSEMBLER_NAME (decl);
+ {
+ while (DECL_THUNK_P (decl))
+ {
+ /* If TARGET_USE_LOCAL_THUNK_ALIAS_P, use_thunk puts the thunk
+ into the same section as the target function. In that case
+ we must return target's name. */
+ tree target = THUNK_TARGET (decl);
+ if (TARGET_USE_LOCAL_THUNK_ALIAS_P (target)
+ && DECL_SECTION_NAME (target) != NULL
+ && DECL_ONE_ONLY (target))
+ decl = target;
+ else
+ break;
+ }
+ name = DECL_ASSEMBLER_NAME (decl);
+ }
return IDENTIFIER_POINTER (name);
}