This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Avoid redundant DECL_ASSEMBLER_NAME computations for ODR types
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 26 Feb 2016 11:52:50 +0100
- Subject: Avoid redundant DECL_ASSEMBLER_NAME computations for ODR types
- Authentication-results: sourceware.org; auth=none
Hi,
while looking into the PR testcase I noticed that we detect wrong duplicate
types. This is because we compute DECL_ASSEMBLER_NAME of a type variant which
is not necessary.
Bootstrapped/regested x86_64-linux and I checked dumps of xalancbmk to verify
that nothing changes in ODR type merging except for the duplicates. OK?
Honza
* tree.c (need_assembler_name_p): Do not compute mangled name for
variabt types.
Index: tree.c
===================================================================
--- tree.c (revision 233707)
+++ tree.c (working copy)
@@ -5329,6 +5329,7 @@ need_assembler_name_p (tree decl)
&& TREE_CODE (decl) == TYPE_DECL
&& DECL_NAME (decl)
&& decl == TYPE_NAME (TREE_TYPE (decl))
+ && TYPE_MAIN_VARIANT (TREE_TYPE (decl)) == TREE_TYPE (decl)
&& !TYPE_ARTIFICIAL (TREE_TYPE (decl))
&& (type_with_linkage_p (TREE_TYPE (decl))
|| TREE_CODE (TREE_TYPE (decl)) == INTEGER_TYPE)