From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58699 invoked by alias); 5 Aug 2015 11:37:12 -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 58687 invoked by uid 89); 5 Aug 2015 11:37:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Wed, 05 Aug 2015 11:37:10 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8BF2FAD82; Wed, 5 Aug 2015 11:37:06 +0000 (UTC) Date: Wed, 05 Aug 2015 11:37:00 -0000 From: Richard Biener To: =?ISO-8859-15?Q?Manuel_L=F3pez-Ib=E1=F1ez?= cc: Gcc Patch List , Jakub Jelinek , Jeff Law , Florian Weimer Subject: Re: PR middle-end/16351 NULL dereference warnings In-Reply-To: Message-ID: References: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1609908220-1334436457-1438774626=:19642" X-SW-Source: 2015-08/txt/msg00260.txt.bz2 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1609908220-1334436457-1438774626=:19642 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT Content-length: 2951 On Mon, 3 Aug 2015, Manuel López-Ibáñez wrote: > PING: https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01860.html > > Actually, the xfailed test was because the function folded to nothing > and the offending code was removed without warning. Fixed in the > attached version. Same changelog. Ok. Thanks, Richard. > > > On 22 July 2015 at 17:52, Manuel López-Ibáñez wrote: > > I took the patch in > > https://gcc.gnu.org/ml/gcc-patches/2014-01/msg01715.html and removed > > the Wnull-attribute part, since most of it can be done from the FE as > > shown in https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01857.html and > > also to make the patch smaller and easier to review. > > > > I also fixed the comments by Florian here: > > https://gcc.gnu.org/ml/gcc-patches/2014-02/msg00149.html and added > > more tests from the PR and its duplicates (one xfailed, I'll open a > > new PR about it). > > > > Futher cleanups may be possible (infer_nonnull_range_by_attribute > > checks flag_delete_null_pointer_checks, which seems weird to me but it > > matches the existing behavior of infer_nonnull_range). > > > > I added this to Wall to get as much testing as possible, we can always > > move it to Wextra or disable it by default just before the release if > > it turns out to be too noisy. > > > > Boostrapped and regression tested on x86_64-linux-gnu. > > > > OK? > > > > gcc/ChangeLog: > > > > 2015-07-22 Manuel López-Ibáñez > > Jeff Law > > > > PR c/16351 > > * doc/invoke.texi (Wnull-dereference): New. > > * tree-vrp.c (infer_value_range): Update call to infer_nonnull_range. > > * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour): > > Warn for potential NULL dereferences. > > (find_explicit_erroneous_behaviour): Warn for NULL dereferences. > > * ubsan.c (instrument_nonnull_arg): Call > > infer_nonnull_range_by_attribute. > > (instrument_nonnull_return): Likewise. > > * common.opt (Wnull-dereference); New. > > * gimple.c (infer_nonnull_range): Remove bool arguments. > > (infer_nonnull_range_by_dereference): New. > > (infer_nonnull_range_by_attribute): New. > > * gimple.h: Update declarations. > > > > gcc/testsuite/ChangeLog: > > > > 2015-07-22 Manuel López-Ibáñez > > Jeff Law > > > > PR c/16351 > > * gcc.dg/tree-ssa/isolate-2.c: Close comment. > > * gcc.dg/tree-ssa/isolate-4.c: Likewise. > > * gcc.dg/tree-ssa/wnull-dereference.c: New test. > > * gcc.dg/tree-ssa/isolate-1.c: Test warnings with -Wnull-dereference. > > * gcc.dg/tree-ssa/isolate-3.c: Likewise. > > * gcc.dg/tree-ssa/isolate-5.c: Likewise. > > * c-c++-common/wnonnull-1.c: New test. > -- Richard Biener SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nuernberg) ---1609908220-1334436457-1438774626=:19642--