https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109123

--- Comment #8 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #7)
> Warning for "escapes" (the store is an escape point) is also sensible I
> think.

Would it be possible to make this distinction at the point of warning? 

> Warning for other uses is really only sensible before any code motion pass
> took place.

Can you move the warning pass before the first code motion pass? 

Or split it in two warning passes: warning for any uses (before code motion)
and warn for escapes and deref (after code motion)?

> Unfortunately the testsuite is full of cases expected to be diagnosed but
> are no longer with any change to the operation.

It is better to miss some warnings rather than warn too much because otherwise
users will use any means available to silence them (often -Wno-use-after-free)
and the useful warnings will be lost.

For comprehensive code analysis, users should look at the static analyzer.

Reply via email to