From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 35739 invoked by alias); 4 Oct 2018 19:40:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 35700 invoked by uid 89); 4 Oct 2018 19:40:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=crude X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Oct 2018 19:40:45 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1g89UJ-0003OW-1U from joseph_myers@mentor.com ; Thu, 04 Oct 2018 12:40:43 -0700 Received: from digraph.polyomino.org.uk (137.202.0.90) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Thu, 4 Oct 2018 20:40:39 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.90_1) (envelope-from ) id 1g89UF-0001K4-0W; Thu, 04 Oct 2018 19:40:39 +0000 Date: Thu, 04 Oct 2018 19:55:00 -0000 From: Joseph Myers To: Jeff Law CC: Richard Biener , Martin Sebor , GCC Patches Subject: Re: [PATCH] avoid warning on constant strncpy until next statement is reachable (PR 87028) In-Reply-To: <23ea3d13-d9c5-1b02-f01c-d2a0e11f3a10@redhat.com> Message-ID: References: <88de1ee3-6ee4-d8d9-3e57-3a42474a4169@redhat.com> <27235a6d-6f2c-1f2d-d456-d4cd9b941894@redhat.com> <23ea3d13-d9c5-1b02-f01c-d2a0e11f3a10@redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2018-10/txt/msg00295.txt.bz2 On Thu, 4 Oct 2018, Jeff Law wrote: > With the natural tensions around warning early vs warning late the > warning analysis phase may choose to mark statements in various ways > rather than issuing the warning at that time. ie, it might choose to > mark the statement with the set of potential issues as well as marking > those which were proven safe. A later pass could then refine things and > issue the actual warning. Or something like that. Note that could include front ends marking expressions for warning issues as well. (E.g. the signed/unsigned warnings, which fold and do some crude checks for cases where they can prove the signed value is never negative.) To avoid that front-end folding you want later code outside the front end to have the information that there was a (comparison / implicit conversion from signed to unsigned) that should be warned about if the later code can't prove the conversion was value-preserving. -- Joseph S. Myers joseph@codesourcery.com