void f (void) { int i; i = 0; i++; } seems like something a natural generalization of -Wunused-but-set-variable should warn for; the value of i is only used as part of an increment of i, so the definition and all uses of this variable could be safely removed.
For a real example of this, see the variable lang_n_infiles in gcc.c:process_command (I'm testing a patch that removes that variable along with other changes). -- Summary: Warn for variables incremented but not used Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jsm28 at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44677