This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/18624] GCC does not detect local variable set but never used
- From: "aldot at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jun 2008 13:04:23 -0000
- Subject: [Bug c/18624] GCC does not detect local variable set but never used
- References: <bug-18624-9596@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from aldot at gcc dot gnu dot org 2008-06-27 13:04 -------
should we
- add a bit so that used_flags:2 and set TREE_USED() = 2 in
expand_assignment(), expand_expr_real_1, adjust setting tree
addressable(decl)=!!TREE_USED(decl), set it in gimplify_modify_expr_rhs() for
vars that are not init-self, expand_one_var() etc.
or
- warn on has_zero_uses() in something like ccp?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18624