Hi, there are only two places left where frontend is fiddling with TREE_SYMBOL_REFERENCED. The first should not be needed because alias code now properly analyze the aliases in callgraph. The second can be replaced by TREE_USED (and I think should be). It is only needed to the following decl_needed_p knows about it.
Bootstrapped/regtested x86_64-linux, OK? Honza * method.c (make_alias_for): Do not set TREE_SYMBOL_REFERENCED. * decl2.c (mark_needed): Likewise. (decl_needed_p): Do not test TREE_SYMBOL_REFERENCED. Index: method.c =================================================================== --- method.c (revision 186623) +++ method.c (working copy) @@ -244,7 +244,6 @@ make_alias_for (tree target, tree newid) TREE_ADDRESSABLE (alias) = 1; TREE_USED (alias) = 1; SET_DECL_ASSEMBLER_NAME (alias, DECL_NAME (alias)); - TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (alias)) = 1; return alias; } Index: decl2.c =================================================================== --- decl2.c (revision 186627) +++ decl2.c (working copy) @@ -1782,10 +1782,7 @@ var_finalized_p (tree var) void mark_needed (tree decl) { - /* It's possible that we no longer need to set - TREE_SYMBOL_REFERENCED here directly, but doing so is - harmless. */ - TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)) = 1; + TREE_USED (decl) = 1; mark_decl_referenced (decl); } @@ -1811,9 +1808,7 @@ decl_needed_p (tree decl) return true; /* If this entity was used, let the back end see it; it will decide whether or not to emit it into the object file. */ - if (TREE_USED (decl) - || (DECL_ASSEMBLER_NAME_SET_P (decl) - && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))) + if (TREE_USED (decl)) return true; /* Functions marked "dllexport" must be emitted so that they are visible to other DLLs. */