From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 416893858D39 for ; Thu, 21 Oct 2021 07:17:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 416893858D39 Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-526-c66KzdqAMUe-iBMdeBSReg-1; Thu, 21 Oct 2021 03:17:46 -0400 X-MC-Unique: c66KzdqAMUe-iBMdeBSReg-1 Received: by mail-lj1-f198.google.com with SMTP id g5-20020a2e9e45000000b00210e9d8299bso2462712ljk.18 for ; Thu, 21 Oct 2021 00:17:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vs/50lWybMh4krGCWKWOVUycRjZwRuR9IkR/E2Q+Ne8=; b=YxJwZ3/iyegNjh9p8G7udzoNZCVuGmcvC34W2tZbsb6QO4OqhlMwpmkv6P4WeNptRY iHWVWukTM4YEJf5abD1WvzhAXS8kWVvbZGsw0qhuNfhej0rdZ2eeM3wLto3qlknOYvOD 6ElIFnjKqjg242R1JF7X3CxmC3GNCSjHFQxfcW79AY/C2/FA4e+coTo8CJPq1el1DEr3 2Ljk7sOVow0Ucy1iHm6BKj7S7QeUFuqMpDjjQ0JqKwNyIKL+b4m/jFWLRIPkw6ZRWhvJ IKy46k/NKYtSH0CD7jLTbb7Jo0UAzfmBEBxAnsGxPY6iTNAEWA77futtC9vxz6XQbba1 d1ww== X-Gm-Message-State: AOAM53058f2lZQvBWjFqxmdRzf1nZd5qemjIAHUkWOfmdNI0PqboOTUs xRntNukYgp2zFKos1SL8mjeWkWQGvPEAHmsHdhTb1KOBssqvQVxLC4HjGeRzl39U7Dr4naeSGWa 3lS7E1cCwcbzOmFC2eF+r0LxRC23MaE/djg== X-Received: by 2002:a2e:7308:: with SMTP id o8mr3946625ljc.360.1634800665070; Thu, 21 Oct 2021 00:17:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsp3DG6x3v3NFrMDa4iXmPb+hwZMICGXp1tpEdiOrpjIwko8kiAUt0iQnobXdOF1h2/0+LiGFzbUu/zg/nS+U= X-Received: by 2002:a2e:7308:: with SMTP id o8mr3946605ljc.360.1634800664802; Thu, 21 Oct 2021 00:17:44 -0700 (PDT) MIME-Version: 1.0 References: <20211020102816.656714-1-aldyh@redhat.com> <555af8e5-d068-4bf3-23ef-1041f5f7259c@gmail.com> In-Reply-To: From: Aldy Hernandez Date: Thu, 21 Oct 2021 09:17:33 +0200 Message-ID: Subject: Re: [PATCH] Try to resolve paths in threader without looking further back. To: Jeff Law Cc: Martin Sebor , GCC patches , Martin Sebor X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Oct 2021 07:17:52 -0000 On Wed, Oct 20, 2021 at 10:01 PM Jeff Law wrote: > > > > On 10/20/2021 9:15 AM, Aldy Hernandez wrote: > > On Wed, Oct 20, 2021 at 4:35 PM Martin Sebor 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. It is a bit ironic that jump threading helps reduce Wuninitialized false positives, but yet too much of it causes even more false positives. Aldy