From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id 8BB343858C50 for ; Tue, 27 Sep 2022 15:47:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8BB343858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-x530.google.com with SMTP id r62so5938273pgr.12 for ; Tue, 27 Sep 2022 08:47:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=A7lPDuVrUynMkfB4rV4vSvzso6dMUO06kQtdgSD22Zk=; b=Qmgw5qAsMaDQBvRMbN1NLMB8VdP94M2x1DAptC0fCP3zJElBc4DusWqZdTDxmLcM8i MZfd8O9DeBpfYeE49h5sjxPbGUH58cy5My+niLZWj4+7RnMtuX7J7TJPLv7lNyzaz+MY WUj5KFudCpKggwtuEgpEeAJ1oQiRyVFcdOzMPiFMWtbi+uh04kle679Qg68kFBCTMoeQ 9DhL4HiL03gvtrj7vwi7JMDLTBDi0pODC77sdmCqntiMZgk8j3XukYGY9fq6jKDmD16K Wj+fEwRpDkT9jnwMrssMg0lkyXRdDq6yXrHp0Xl9iAQLd44gvmVAayTdFuI9qipBg9qs rTTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=A7lPDuVrUynMkfB4rV4vSvzso6dMUO06kQtdgSD22Zk=; b=BK4Yy6kRWr0+E0tU7kweL3bv+Kj40lDkEoiom0tSMZoUagAlRbWZtL10vSCIzMcY5w RmzWQHitE8/gezffPLH9KD55kD8riBdN2UWEJyCV9UnhR4p+ck85ww/W4e9vIK1WkT7/ 1flodPrua1UlbO8XBvCgtjYN86zI4fUqh2r6kajz6hQqh90jaedZB/t20fLomwoYzPvq fnFxuZbKfhkGQIUteqe4yi4WIBrXIVjV1ogqJXZh984iahgBjlCagqf4uMoeap85Unm3 Yt1VBuS3kpkx3pWDI6hycL3Qe2FanE4007UrGqO3vmWnEjP/qKjdFKbhBnbWMqNsetPU vD3Q== X-Gm-Message-State: ACrzQf20wdw8fzzH6jVSXH+O65jrGTODrgSpOXmkslIDcsGtb3sHiFvT 25/mAxFxiVHpXf1A9kaXICkBaQ7aLj0gUQ== X-Google-Smtp-Source: AMsMyM6x47ehNjSgaMfmwrr7fwNscLqdIGudVY+TpDqLT1b6rFNOSTXm8YdBHs+JHAVjRcIAUCp9ZA== X-Received: by 2002:a62:e911:0:b0:555:8c06:c9eb with SMTP id j17-20020a62e911000000b005558c06c9ebmr27596052pfh.52.1664293648911; Tue, 27 Sep 2022 08:47:28 -0700 (PDT) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id l9-20020a170903244900b001755e4278a6sm1136122pls.261.2022.09.27.08.47.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Sep 2022 08:47:28 -0700 (PDT) Message-ID: Date: Tue, 27 Sep 2022 09:47:26 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH][RFC] tree-optimization/105646 - re-interpret always executed in uninit diag Content-Language: en-US To: gcc-patches@gcc.gnu.org References: <20220822061649.3AF011332D@imap2.suse-dmz.suse.de> From: Jeff Law In-Reply-To: <20220822061649.3AF011332D@imap2.suse-dmz.suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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