From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by sourceware.org (Postfix) with ESMTPS id 2650238515F0 for ; Wed, 5 May 2021 07:27:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2650238515F0 Received: by mail-ed1-x536.google.com with SMTP id di13so771918edb.2 for ; Wed, 05 May 2021 00:27:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wET+B7G0OyVbBhcTpmde0h1kpiQL/+z/0EH/PjfyxrU=; b=QizyxNzhn5nKcifnYOkQPx9c7LVwbC6g6M8I9jxwUBUHmNo7jMqf+bxpxrw+/DRZZv 7SWW6Q+UEHJ09y0BmgR3QtgBWM81l9wxyLnvLzxSLxkxAml3ZLxHLblEChRNuq23tBaD R2DGqaZ4e7GLL+TUn42SljEXYEbuxVaQXDXYCGDMzfX2OzywZwnrCBDc5gP+wM7jTdoL dDYniv5n4q7ObAlJjOmGij7xh4JZnRV3j5rbZX3Jj7NRpq6ijJuRIVPCTh/e9Nuaen+r 00iD/a82iperyG/m5fTCBAFnT3KOKLJ9XD0zAz+JvPQbAkhpowJ6mIWt8BSVpuIqbtz6 /kGg== X-Gm-Message-State: AOAM532lyZvmMp01+yVKLiV0eMDxY4TEuqRmhIzhd/Tld6zRJnhhdayn 2AweGzQcCsDE3hWyFL1qIk0eCnm+zRHHSF6bU/s= X-Google-Smtp-Source: ABdhPJw/ukT0+C95LWz5Jud2fnGr1KKWv9GuTkjOp/XneNYgA+euAaMh7Hl/3xNbS6eYy0xWIl1yfL1G4l8VZCtjnnU= X-Received: by 2002:a05:6402:2d6:: with SMTP id b22mr30971228edx.274.1620199622167; Wed, 05 May 2021 00:27:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Wed, 5 May 2021 09:26:50 +0200 Message-ID: Subject: Re: [PATCH] run early sprintf warning after SSA (PR 100325) To: Martin Sebor Cc: gcc-patches , Aldy Hernandez Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Wed, 05 May 2021 07:27:08 -0000 On Wed, May 5, 2021 at 1:32 AM Martin Sebor via Gcc-patches wrote: > > With no optimization, -Wformat-overflow and -Wformat-truncation > runs early to detect a subset of simple bugs. But as it turns out, > the pass runs just a tad too early, before SSA. That causes it to > miss a class of problems that can easily be detected once code is > in SSA form, and I would expect might also cause false positives. > > The attached change moves the sprintf pass just after pass_build_ssa, > similar to other early flow-sensitive warnings (-Wnonnull-compare and > -Wuninitialized). Makes sense. I suppose walloca might also benefit from SSA - it seems to do range queries which won't work quite well w/o SSA? Thus OK. Thanks, Richard. > Martin