From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123189 invoked by alias); 25 Jul 2017 03:13:51 -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 123180 invoked by uid 89); 25 Jul 2017 03:13:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*M:fb96 X-HELO: mail-qk0-f181.google.com Received: from mail-qk0-f181.google.com (HELO mail-qk0-f181.google.com) (209.85.220.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Jul 2017 03:13:49 +0000 Received: by mail-qk0-f181.google.com with SMTP id d145so55516588qkc.2 for ; Mon, 24 Jul 2017 20:13:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=Qm4/ugV4mk3E8S0p8v5JMBmLrGf15VyDtzdmx9KrXU8=; b=JBX5O51rXcRZtjFPLeJw/Piv5HUQy5CE7FGbPLz1KzXRTS5cTW144ldyDcEVjeif2S 7otQ6NaApMH4zJt/zyZUmDLPNkIXnK00vPiB2hngoxqWQvXrdMuEGKdVdAHqfaCT2Emc M4y/NGBrC8CFS49trbG5SYDmAtb4HXtHYERktnMLSjxMAqw4Jqk0B8rusUjFT0AgcOXQ 532pc+2BoM5P7j2+5Z9ucimqQoZTWXdmodVaafNNgX1K4NHb/xoxUeeA470TgKAMTVOU ai7ylMvPJTUC5ZlD0mA/6Re3WZI5a3q7844lCslyTy2t+p/SEOjgXjGpkevJmuQlYOPP uwJw== X-Gm-Message-State: AIVw111Htcn4GOuOAxIFchkcakkXAhchQgK6bn4Bqe0ce6YI2dsWPBQI swMr8xXPOqpiL8uz X-Received: by 10.55.215.26 with SMTP id m26mr21627978qki.95.1500952427618; Mon, 24 Jul 2017 20:13:47 -0700 (PDT) Received: from localhost.localdomain (75-171-229-159.hlrn.qwest.net. [75.171.229.159]) by smtp.gmail.com with ESMTPSA id s2sm3878144qkl.84.2017.07.24.20.13.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jul 2017 20:13:47 -0700 (PDT) Subject: [PING] [PATCH] enhance -Wrestrict to handle string built-ins (PR 78918) To: Gcc Patch List References: <8a0de82f-d68e-9c37-0406-f216e3f92884@gmail.com> From: Martin Sebor Message-ID: Date: Tue, 25 Jul 2017 03:13:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg01488.txt.bz2 Ping: https://gcc.gnu.org/ml/gcc-patches/2017-07/msg01264.html This change is related to [PATCH] enhance -Wrestrict for sprintf %s arguments https://gcc.gnu.org/ml/gcc-patches/2017-07/msg01176.html On 07/20/2017 02:45 PM, Martin Sebor wrote: > With more testing (building GDB, Glibc, Busybox, and the Linux > kernel) I found a few bugs and weaknesses in the initial patch. > Attached is version 2 that fixes the uncovered problems and makes > further enhancements to handle more cases. > > Martin > > On 07/16/2017 05:47 PM, Martin Sebor wrote: >> Being implemented in the front end, the -Wrestrict warning >> detects only trivial instances of violations. The attached >> patch extends the implementation to the middle-end where >> data flow and alias analysis can be combined to detect even >> complex cases of overlap. This work is independent of but >> follows on the patch below (waiting for review): >> >> https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00036.html >> >> The changes rely on extending the tree-ssa-{alias,structalias} >> machinery in a simple way to answer the "must-alias" kind of >> question in addition to the current "may-alias." >> >> The rest of the changes are in gimple-fold.c, tree-ssa-strlen.c, >> and builtins.c. >> >> Even though this change makes -Wrestrict a lot more useful, it's >> not a complete implementation. Not all built-ins are handled yet >> (e.g., strncat), and support for user-defined functions is still >> subject to the limitations of the front end implementation. To >> complete the support, handlers for the missing string built-ins >> will need to be added to tree-ssa-strlen.c, and the remaining >> bits should be moved from the front end to somewhere in >> the middle-end (e.g., calls.c). >> >> Martin >