From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105329 invoked by alias); 7 Mar 2017 18:12:15 -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 105314 invoked by uid 89); 7 Mar 2017 18:12:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=popping, late X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Mar 2017 18:12:13 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0DD13C04B93D; Tue, 7 Mar 2017 18:12:14 +0000 (UTC) Received: from localhost.localdomain (ovpn-120-51.rdu2.redhat.com [10.10.120.51] (may be forged)) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v27ICDr8027600; Tue, 7 Mar 2017 13:12:13 -0500 Subject: Re: [PATCH] Fix PR79345, better uninit warnings for memory To: Richard Biener , gcc-patches@gcc.gnu.org References: From: Jeff Law Message-ID: Date: Tue, 07 Mar 2017 18:12:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-03/txt/msg00327.txt.bz2 On 03/01/2017 07:03 AM, Richard Biener wrote: > > The following addresses a regression in uninit warnings that happens > because clobber stmts preclude the very simple-minded support we have > for memory. The patch fixes this by instead implementing uninit > warnings for memory properly, using the alias oracle walk_aliased_vdefs > helper. > > The patch adds better limiting to that interface and fixes one > false positive in fixed-value.c. Two other false positives are > fixed by the wide-int.h patch posted a few hours ago and a patch > to genemit from Jakub. > > Bootstrap and regtest running on x86_64-unknown-linux-gnu with those > prerequesites included. > > One issue with the patch is duplicate warnings as TREE_NO_WARNING > doesn't work very well on tcc_reference trees which are not > shared. A followup could use some sort of hash table to mitigate > this a bit. OTOH for maybe-uninit uses multiple locations may > be in need to be fixed to silence the warning. Another thing is > that we walk the function in random (BB) order and thus the > alias oracle walk limiting may result in warnings popping up > and going away in less predictable order (and also be reported > in odd order, like not all must-uninits first). > > Comments? I realize this may introduce (a lot of?) false positives > quite late in the game, more aggressive limiting, like to 2 > disambiguations, could solve the testcase in the PR and give up > most of the times while preserving the non-walking case of the > old code. I'm all for it. Even if it triggers some false positives, improved detection of uninit memory at compile time is a big win in my mind. jeff