public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Jeff Law <jeffreyalaw@gmail.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH][RFC] tree-optimization/105646 - re-interpret always executed in uninit diag
Date: Thu, 29 Sep 2022 10:25:16 +0200	[thread overview]
Message-ID: <CAFiYyc0+jN+bx1QC77wWZ7=O7B=Xh6AfPh_cfk6MAagqj5D8dA@mail.gmail.com> (raw)
In-Reply-To: <a8034317-cd22-409e-fde1-66e2d7f02415@gmail.com>

On Tue, Sep 27, 2022 at 5:48 PM Jeff Law via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
>
> On 8/22/22 00:16, Richard Biener via Gcc-patches wrote:
> > The following fixes PR105646, not diagnosing
> >
> > int f1();
> > int f3(){
> >      auto const & a = f1();
> >      bool v3{v3};
> >      return a;
> > }
> >
> > with optimization because the early uninit diagnostic pass only
> > diagnoses always executed cases.  The patch does this by
> > re-interpreting what always executed means and choosing to
> > ignore exceptional and abnormal control flow for this.  At the
> > same time it improves things as suggested in a comment - when
> > the value-numbering run done without optimizing figures there's
> > a fallthru path, consider blocks on it as always executed.
> >
> > Bootstrapped and tested on x86_64-unknown-linux-gnu.
> >
> > OK?
> >
> > Thanks,
> > Richard.
> >
> >       PR tree-optimization/105646
> >       * tree-ssa-uninit.cc (warn_uninitialized_vars): Pre-compute
> >       the set of fallthru reachable blocks from function entry
> >       and use that to determine wlims.always_executed.
> >
> >       * g++.dg/uninit-pr105646.C: New testcase.
>
> I'm torn on this.  On one hand, ignoring abnormal flow control in the
> early pass is almost certainly going to result in false positives but
> it's also going to result in fixing some false negatives.
>
> I'm willing to ACK and see what the real world fallout is in the spring
> when the distros run their builds.  Your call.

I have pushed this now after retesting.  Let's see if there's any bad
fallout - we can certainly reconsider.

Richard.

>
> Jeff
>
>

      reply	other threads:[~2022-09-29  8:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-22  6:16 Richard Biener
2022-09-27 15:47 ` Jeff Law
2022-09-29  8:25   ` Richard Biener [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFiYyc0+jN+bx1QC77wWZ7=O7B=Xh6AfPh_cfk6MAagqj5D8dA@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).