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

--- Comment #13 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #10)
> Now, I agree that ideally, GCC should warn for your last testcase. But I
> guess in that case inlining either doesn't happen or it happens too late, so
> GCC only sees the first case.

Actually it is the reverse, inlining happens earlier in this new testcase (the
first example was recursive, which makes the inliner more conservative).

> The analysis that GCC performs are predicated
> on the transformations leading to better code, otherwise they are not
> performed. A tool for static analysis will surely inline as much as it
> could, not matter if the code is slower or larger, but this is not how GCC
> works because GCC is not a tool for static analysis.

Maybe we could have a wiki page explaining what options to tweak (inlining
parameters, etc) for a compilation where you are only interested in warnings?
(I had vaguely mentioned creating -Ow at some point, but that didn't seem such
a good idea)

Reply via email to