This is the mail archive of the gcc-patches@gcc.gnu.org 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]

Re: Patch: Prune unused DECL_STMTs from saved tree structure



  In message <20000828101008.V17776@wolery.cumb.org>you write:
  > 
  > I started out trying to discard all DECL_STMTs and VAR_DECLS that
  > didn't have their used bit set.  However, it turns out that there are
  > several cases where a variable is referenced but TREE_USED(decl) is
  > false.  For instance, anything with an initialization expression and
  > no further use; anything with a constructor or destructor (however
  > trivial); and then there were these mysterious unnamed variables
  > introduced by __builtin_va_arg, which is when I gave up trying to
  > account for all the cases.
We should attack this separately.  It sounds rather lame to me that we have
things which are used, but which don't have TREE_USED set.

  > Six and a half megs
  > is not to be sneezed at, though, and we can always make it more
  > aggressive later. 
Agreed.

  >  I put remove_unused_decls in c-semantics.c because
  > the C front end will want it too, as soon as it switches to function
  > at a time mode; it's only used from C++ right now.  (This
  > unfortunately means it doesn't know how to look inside try/catch
  > blocks.)
Understood.  Is there some reason why we can't promote those tree nodes to
tree.def in the main directory instead of having them be C++ specific?

  > 	* c-semantics.c (remove_unused_decls,
  > 	remove_unused_decls_from_block): New functions.
  > 	* c-common.h: Prototype remove_unused_decls.
  > cp:
  > 	* semantics.c (finish_stmt_tree): Call remove_unused_decls.
This is fine.  Please install this patch.


Thanks,
jeff


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