------- Comment #15 from manu at gcc dot gnu dot org 2009-08-04 10:52 ------- (In reply to comment #14) > (In reply to comment #13) > > > We need someone to write the patch. Just that. > > I've got some spare time now, so I'd like to have a go.
If you want your code to be useful, fill a copyright assignment: http://gcc.gnu.org/contribute.html#legal > I can see that used_flag bitfield can be expanded from 1 bit to 2 bits. > I can see that TREE_USED macro can be reworked to match. Reworked how? > What concerns me is all the different places (currently 170) that the > text pattern "TREE_USED.*=" occurs. > > I suspect a manual review of each of those 170 places would be > prone to failure. Even without considering the various languages > in sub directories, there are still 84 uses of "TREE_USED.*=" left. Focus on the C front-end: the c-* files, fold* and tree.c > gdb with 84 breakpoints doesn't sound feasible to me. I really do not see any alternative. For your test program, you shouldn't hit all breakpoints, so the only problem is setting them. First try with the ones more likely and extend. As I see this, you should just find those places where b is marked as used although it is only assigned. Then perhaps it will suffice to not mark it as used but as "set", perhaps this is done already, so one does not need to mark it as set either. Then in pop_scope in c-decl.c check for this following the existing check for Wunused_variable in order to give the proper warning message. (BTW, this has nothing to do with Wuninitialized) -- manu at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- OtherBugsDependingO|24639 | nThis| | Last reconfirmed|2006-02-01 04:34:36 |2009-08-04 10:52:25 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18624