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


>>>>> Jeffrey A Law <law@cygnus.com> writes:

 >   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.

The latter case is probably a bug, but the former is by design.  We still
want to get -Wunused warnings for objects with constructors that are
declared but never used, so we clear TREE_USED.  Perhaps that is a mistake.

Jason

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