public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH][RFC] tree-optimization/105646 - re-interpret always executed in uninit diag
Date: Tue, 27 Sep 2022 09:47:26 -0600	[thread overview]
Message-ID: <a8034317-cd22-409e-fde1-66e2d7f02415@gmail.com> (raw)
In-Reply-To: <20220822061649.3AF011332D@imap2.suse-dmz.suse.de>


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.


Jeff



  reply	other threads:[~2022-09-27 15:47 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 [this message]
2022-09-29  8:25   ` Richard Biener

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=a8034317-cd22-409e-fde1-66e2d7f02415@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).