From 1ee85ee19b06863781374b7c9f97e4f6e931118b Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Fri, 12 Sep 2014 01:16:42 +0200 Subject: common.opt (flto-odr-type-merging): New flag. * common.opt (flto-odr-type-merging): New flag. * ipa-deivrt.c (hash_type_name): Use ODR names for hasing if availale. (types_same_for_odr): Likewise. (odr_subtypes_equivalent_p): Likewise. (add_type_duplicate): Do not walk type variants. (register_odr_type): New function. * ipa-utils.h (register_odr_type): Declare. (odr_type_p): New function. * langhooks.c (lhd_set_decl_assembler_name): Do not compute TYPE_DECLs * doc/invoke.texi (-flto-odr-type-merging): Document. * tree.c (need_assembler_name_p): Compute ODR names when asked for it. * tree.h (DECL_ASSEMBLER_NAME): Update comment. * lto.c (lto_read_decls): Register ODR types. From-SVN: r215196 --- gcc/langhooks.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/langhooks.c') diff --git a/gcc/langhooks.c b/gcc/langhooks.c index 8ff91ba..7d4c294 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -147,6 +147,11 @@ lhd_set_decl_assembler_name (tree decl) { tree id; + /* set_decl_assembler_name may be called on TYPE_DECL to record ODR + name for C++ types. By default types have no ODR names. */ + if (TREE_CODE (decl) == TYPE_DECL) + return; + /* The language-independent code should never use the DECL_ASSEMBLER_NAME for lots of DECLs. Only FUNCTION_DECLs and VAR_DECLs for variables with static storage duration need a real -- cgit v1.1