This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA, C++] Symbol table 11/many: Avoid C++ FE from fiddling with TREE_SYMBOL_REFERENCED

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?


	* 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;
   return alias;
Index: decl2.c
--- decl2.c	(revision 186627)
+++ decl2.c	(working copy)
@@ -1782,10 +1782,7 @@ var_finalized_p (tree var)
 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_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)
+  if (TREE_USED (decl))
       return true;
   /* Functions marked "dllexport" must be emitted so that they are
      visible to other DLLs.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]