aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2014-05-28 12:38:23 -0400
committerJason Merrill <jason@gcc.gnu.org>2014-05-28 12:38:23 -0400
commitd67ff7b75deab58eaac2edccafbc55d32f60ed0d (patch)
tree53efc05fb878998b2cf66e3d30efe41a6bfd5650 /gcc/cp/decl.c
parenta41acf5f3e06afa2790ff826b16ccccf1959842c (diff)
downloadgcc-d67ff7b75deab58eaac2edccafbc55d32f60ed0d.zip
gcc-d67ff7b75deab58eaac2edccafbc55d32f60ed0d.tar.gz
gcc-d67ff7b75deab58eaac2edccafbc55d32f60ed0d.tar.bz2
re PR c++/47202 (Endless recursion during mangling)
PR c++/47202 gcc/cp/ * decl.c (cxx_comdat_group): Return a decl. * optimize.c (cdtor_comdat_group): Get its DECL_ASSEMBLER_NAME. gcc/ * cgraph.h (symtab_node::get_comdat_group_id): New. * cgraphunit.c (analyze_functions): Call it. * symtab.c (dump_symtab_node): Likewise. * tree.c (decl_comdat_group_id): New. * tree.h: Declare it. * lto-streamer-out.c (write_symbol): Use it. * trans-mem.c (ipa_tm_create_version_alias): Likewise. From-SVN: r211026
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 9e97ff8..3502447 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -14484,18 +14484,17 @@ cp_missing_noreturn_ok_p (tree decl)
return DECL_MAIN_P (decl);
}
-/* Return the COMDAT group into which DECL should be placed. */
+/* Return the decl used to identify the COMDAT group into which DECL should
+ be placed. */
tree
cxx_comdat_group (tree decl)
{
- tree name;
-
/* Virtual tables, construction virtual tables, and virtual table
tables all go in a single COMDAT group, named after the primary
virtual table. */
if (VAR_P (decl) && DECL_VTABLE_OR_VTT_P (decl))
- name = DECL_ASSEMBLER_NAME (CLASSTYPE_VTABLES (DECL_CONTEXT (decl)));
+ decl = CLASSTYPE_VTABLES (DECL_CONTEXT (decl));
/* For all other DECLs, the COMDAT group is the mangled name of the
declaration itself. */
else
@@ -14513,10 +14512,9 @@ cxx_comdat_group (tree decl)
else
break;
}
- name = DECL_ASSEMBLER_NAME (decl);
}
- return name;
+ return decl;
}
/* Returns the return type for FN as written by the user, which may include