On Wed, May 20, 2026 at 5:14 PM Sam James via Gcc <[email protected]> wrote:
>
> Jonathan Wakely via Gcc <[email protected]> writes:
>
> > The false positive rate has been unacceptably high for years, with
> > very little progress on reducing that rate.
> >
> >
> > Despite repeated requests, the warnings still lie. They tell users
> > there *is* an overflow, when what they should say is that there might
> > be, for some specific control flow which might actually be unreachable
> > or in dead code. We should not be lying to users with -Wall.
>
> Indeed. With Qing's -fdiagnostics-show-context=N, it's a bit better, but
> it doesn't help all of the time: either with certain (common still)
> cases with warnings it supports, and with warnings it is not yet wired
> up for.
>
> It does help and her work has been quite helpful, but as-is, it's not a
> solution to the problem.
>
> > [...]
> >
> > Can we please admit that those warnings do not have a good enough
> > signal-to-noise ratio to be in -Wall? Or can the people who want to
> > keep them be auto-ASSIGNED all related bugs, so that everybody else
> > can focus on other things? Currently the burden of dealing with these
> > false positives is on people working on unrelated parts of GCC, and
> > even worse, on end users.
>
> Please, yes. We keep getting users thinking their code is being
> miscompiled as a result, or wasting time especially with C++ where it's
> deep in libstdc++. Having to explain over and over that it's secretly a
> missed optimisation most of the time is tiresome and not fair on those
> who spend time reporting these bugs.
>
> I don't think the current state reflects well on GCC and it gives people
> the wrong impression.
>
> We can keep the warnings, but they shouldn't be in -Wall. A group like
> -Wmiddle-end (IIRC Jakub may have had a better name suggestion for that
> in the past, I would have to go looking) may be nice to help people
> still use them more easily.

I'm OK with that that though moving the diagnostics earlier might be another
option.  But once they are no longer in -Wall I fear nobody will enable them
and so we can as well eliminate the then unused (and actually unmaintained
for large parts) code ...

IMO the middle-end diagnostics all have the issue that they attempt
to also report maybe-issues.  Rather than proving that all paths lead
to failure we're reporting when we fail to prove all paths are OK.  That's
especially prone to missed optimization issues.

Richard.

> Just this week I had a friend roll out new GCC at work waste hours on a
> bunch of these.
>
> thanks,
> sam

Reply via email to