Hi!

I'm currently looking into possibilities to improve GCC for 
static-code-analysis features.
Some weeks ago I proposed re-introducing -Wunreachable-code for finding dead 
code:

  http://gcc.gnu.org/ml/gcc-patches/2011-12/msg00385.html

(The warning was removed in 
http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00251.html)

Though I have not got any reply yet, the patch might be wrong, but possibly the 
remove_bb() call
could have some kind of 'reason' parameter to avoid false positives?

Also I last year sent out ideas about static code analysis in:

  http://gcc.gnu.org/ml/gcc/2011-02/msg00227.html

And got positive response. When I tries to check eg. null-deref-checking I 
though
found some work done on this, the 'bug' is on

  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16351

I found a patch that add an extra 'static code analysis' pass to check 
null-dereferencing at:

  http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00423.html

Though it was concluded that this should be done fold_stmt() function, is this 
still valid?
And what is the difference between adding an additional 
static-code-analysis-pass compared to
this null-checking pass? (Even though all optimization workers have been done 
before checking this).

I really would like to see under 2012 some more static code analysis features 
to be added to GCC,
like null-deref-checking and dead-code checkers, possibly even better 
array-over/under-run-bounds-checkers?

Any comments or ideas are most welcome!

Thanks and Best Regards,
Fredrik

Reply via email to