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

--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Thanks for filing this bug.

It's analyzing "a" twice: as called by main, and as a standalone function.

The warning comes from the analysis of "a" as a standalone function; if I
delete "main" from the reproducer, it still reports it:
  https://godbolt.org/z/eKnGPYWee
and we have code where:

   if (e == 0) {
       /* ...snip... */
       *e = 1;
   }

which definitely feels like something we ought to warn about.

So I think the issue here is that you weren't expecting "a" to be analyzed
standalone, but rather as called by "main", where "e" is known to be non-NULL
and hence that code is dead.  

Is this reduced from a less trivial example?

I'm not quite sure what to do about such cases.

Reply via email to