From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id 46A373858D28 for ; Thu, 29 Sep 2022 08:25:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 46A373858D28 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-ed1-x52f.google.com with SMTP id m3so918220eda.12 for ; Thu, 29 Sep 2022 01:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=KL3f5ysD6pXEsH9fvhNd45tT4eK34UTorP4xeAnXqf8=; b=Q//vBwn+YwkaFlcP1BaPqb1IaNj+zq6Ny0ACbRVLABsv3RoumajWiVEtHU4j8BLtVk svrjIqyVBpSs/P8GLCQjsJIG35Xhx1NWaDhvBMmpOvbSHTnTcGjBduJJLavMZzyl1jlh 3KG/j/Fn4AhvICsgUeIJ5+9nVnReIA1IMc+OyaqNK/T4bnbd40ikfydJLErwtM3g3qus Oth0HjWheqz8bfpWZJtbF857lYj71GQict7VC7hEN3jjuhaEHawc6xgRnW2WNTtaU03O PV+vUyzz4JvvSWNKsYuHp9VjgKJvHIGUcL0oR5sfO3nvCwPyNdS1NhBZYBVk7oRuzVhx n3JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=KL3f5ysD6pXEsH9fvhNd45tT4eK34UTorP4xeAnXqf8=; b=NxyEXGv+B9Y/6x/305FLO5BP7JSKOCw0UpvyYp8S3Johu2CYymCV/CY5jLP3M3vk0p rPCXgHXGNp7apUlsqx8bqY2FrXwpexCCrcaHkFv4dhP2PBFuDmuZHx46dhELHmgmtxCS VrCD+ghyt7dRrVURR3rhUZdkK2w+9xiwz+mUoAkLe8juHmdDualkt5Bcsc0ARQm2XAun kf7XfaQLA0TlKSrfc43WQkm2O+6VfCSO/xT3yrI9N8AdB7W1Aqaw8DWT9raxM+PxPE9/ OzL+Jls0HT2P0z3A+DJ/ZB3C5aATSvVkZQR/laG7VKSrKpj0mmL8Cs1sH904sV4lAUye Lz1Q== X-Gm-Message-State: ACrzQf0yKUYgTsmq1HjifcZ6BwtLRDRKW0/PSxR/wDJ6qBDVIj3q4HmS Az+wVuFf3dHZVhrDjpvftAvmHj6aZrtN6AkDRmo= X-Google-Smtp-Source: AMsMyM55hrlMXnJ/Vl6ZyQvL8E+j/ILMlHc7jOQyOSgEsTfow9iUak0r9I2vsCIcQOmX75RPPa+CupzwNjlWdb6xkXQ= X-Received: by 2002:a05:6402:3596:b0:450:c4d9:a04b with SMTP id y22-20020a056402359600b00450c4d9a04bmr2160830edc.218.1664439928959; Thu, 29 Sep 2022 01:25:28 -0700 (PDT) MIME-Version: 1.0 References: <20220822061649.3AF011332D@imap2.suse-dmz.suse.de> In-Reply-To: From: Richard Biener Date: Thu, 29 Sep 2022 10:25:16 +0200 Message-ID: Subject: Re: [PATCH][RFC] tree-optimization/105646 - re-interpret always executed in uninit diag To: Jeff Law Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 Tue, Sep 27, 2022 at 5:48 PM Jeff Law via Gcc-patches 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 > >