public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Aldy Hernandez <aldyh@redhat.com>
Cc: Martin Sebor <msebor@gmail.com>,
	GCC patches <gcc-patches@gcc.gnu.org>,
	Martin Sebor <msebor@redhat.com>
Subject: Re: [PATCH] Try to resolve paths in threader without looking further back.
Date: Thu, 21 Oct 2021 11:59:34 -0600	[thread overview]
Message-ID: <ad28ac23-934d-2f2b-bd8d-20a031f4e14b@gmail.com> (raw)
In-Reply-To: <CAGm3qMWzQZFAQuxO4_SKArHFeQBveo3bydafiPZVC5a1UmCfdg@mail.gmail.com>



On 10/21/2021 1:17 AM, Aldy Hernandez wrote:
> On Wed, Oct 20, 2021 at 10:01 PM Jeff Law <jeffreyalaw@gmail.com> wrote:
>>
>>
>> On 10/20/2021 9:15 AM, Aldy Hernandez wrote:
>>> On Wed, Oct 20, 2021 at 4:35 PM Martin Sebor <msebor@gmail.com> wrote:
>>>
>>>> I appreciate the heads up.  I'm happy that the threader has
>>>> improved.  I'm obviously not pleased that it has led to regressions
>>>> in warnings but I understand that in some cases they might be due
>>>> to limitations in the warning code.  I think the test case you have
>>>> xfailed might be one such example.  The uninitialized warnings are
>>>> exquisitely sensitive to these types of changes.  If/when this patch
>>>> is applied please reopen PR 89230 and reference this commit.
>>>>
>>>> Having said that, to maintain the quality of diagnostics,
>>>> the work that goes into these nice optimizer improvements needs
>>>> to be balanced by an effort to either update the warning code
>>>> to cope with the IL changes, or the optimizers need to take care
>>>> to avoid exposing undefined code that the warnings are designed
>>>> to detect.  I'm concerned not just that the quality of GCC 12
>>>> diagnostics has been eroding, but also that it seems to be not
>>>> just acceptable but expected.
>>> You make a very good point.  It is certainly not my intention to make
>>> life difficult for the warning maintainers, but I'm afraid I don't
>>> have sufficient knowledge in the area to improve them.
>>>
>>> There may be some low hanging fruit though.  At least in the warnings
>>> that use the ranger, there's no reason to run these passes so late in
>>> the pipeline.  You could run the warning code as early as you want,
>>> insofar as SSA is available and the CFG has been built.  Heck, you may
>>> even be able to run at -O0, though we may need some sort of value
>>> numbering.  I believe Richi even suggested this a while back.
>> Running them later in the pipeline is to take advantage of the
>> optimizers removing dead and unreachable code as much as possible. In
>> fact, that's critical to -Wuninitialized.  Optimizing away unreachable
>> paths  to avoid Wuninitialized false positives has been the major driver
>> of jump threading improvements for the last 15 years.
> Ughh, that's unfortunate.  We're gonna have to come up with
> improvements to the Wuninitialized code, or a different paradigm
> altogether.  I'm afraid this will only get worse.
Well, good luck with a different paradigm :-)  It's a tough little nut.  
As long as we want to reduce false positives, then we're going to be 
dependent on optimization and related analysis.

And as I've noted before, we're generally better off fixing the 
optimizers when we stumble over a false positive from Wuninitialized.  
When that's not possible, we should look to fix the predicate analysis 
code.

>
> It is a bit ironic that jump threading helps reduce Wuninitialized
> false positives, but yet too much of it causes even more false
> positives.
I would expect the latter to be relatively rare for Wuninitialized. I 
think some of the other middle end warnings may be in a different boat 
though.



jeff

  parent reply	other threads:[~2021-10-21 17:59 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 10:28 Aldy Hernandez
2021-10-20 14:35 ` Martin Sebor
2021-10-20 15:15   ` Aldy Hernandez
2021-10-20 20:01     ` Jeff Law
2021-10-21  7:17       ` Aldy Hernandez
2021-10-21 14:50         ` Martin Sebor
2021-10-22 11:22           ` Aldy Hernandez
2021-10-22 14:27             ` Martin Sebor
2021-10-22 15:18               ` Aldy Hernandez
2021-10-22 15:59                 ` Martin Sebor
2021-10-23  8:31                   ` Aldy Hernandez
2021-10-21 17:59         ` Jeff Law [this message]
2021-10-21  7:22       ` Richard Biener
2021-10-20 20:19 ` Jeff Law
2021-10-21 10:15   ` Aldy Hernandez
2021-10-22  3:34     ` Jeff Law
2021-10-22  3:53       ` Aldy Hernandez
2021-10-24 16:57         ` Jeff Law
2021-10-24 17:55           ` Bernhard Reutner-Fischer
2021-10-24 18:21           ` Richard Biener
2021-10-24 18:25           ` Aldy Hernandez
2021-10-25  6:47             ` Aldy Hernandez
2021-10-25 18:42             ` Jeff Law
2021-10-25 18:49               ` Aldy Hernandez
2021-10-25 18:58                 ` Jeff Law
2021-10-25 16:58 ` Andrew MacLeod
2021-10-25 17:01   ` Aldy Hernandez
2021-10-25 17:02   ` Jeff Law

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=ad28ac23-934d-2f2b-bd8d-20a031f4e14b@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=aldyh@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=msebor@gmail.com \
    --cc=msebor@redhat.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).