From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94745 invoked by alias); 1 Dec 2016 16:30:41 -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 94733 invoked by uid 89); 1 Dec 2016 16:30:40 -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,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1418 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 ESMTP; Thu, 01 Dec 2016 16:30:30 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 43964AABE; Thu, 1 Dec 2016 16:30:28 +0000 (UTC) Subject: Re: [RFC][PATCH] Speed-up use-after-scope (re-writing to SSA) To: Jakub Jelinek References: <20161102125609.GQ3541@tucnak.redhat.com> <20161102130612.GR3541@tucnak.redhat.com> <774a5d54-30f6-3212-ea4c-21e751356055@suse.cz> <20161116130733.GT3541@tucnak.redhat.com> <469bf86a-e43c-c571-66e4-87db78b6fb11@suse.cz> <20161116162841.GX3541@tucnak.redhat.com> <2f58b0f3-6f62-340d-1c92-9e66e2101244@suse.cz> <20161123141354.GM3541@tucnak.redhat.com> Cc: Richard Biener , GCC Patches From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: Date: Thu, 01 Dec 2016 16:30:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161123141354.GM3541@tucnak.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2016-12/txt/msg00099.txt.bz2 On 11/23/2016 03:13 PM, Jakub Jelinek wrote: > On Wed, Nov 23, 2016 at 02:57:07PM +0100, Martin Liška wrote: >> I started review process in libsanitizer: https://reviews.llvm.org/D26965 >> And I have a question that was asked in the review: can we distinguish between load and store >> in case of having usage of ASAN_POISON? > > I think with ASAN_POISON it is indeed just loads from after scope that can > be caught, a store overwrites the variable with a new value and when turning > the store after we make the var no longer addressable into SSA form, we > loose information about the out of scope store. Furthermore, if there is > first a store and then a read, like: > if (argc != 12312) > { > char my_char; > ptr = &my_char; > } > *ptr = i + 26; > return *ptr; > we don't notice even the read. Not sure what could be done against that > though. I think we'd need to hook into the into-ssa framework, there it > should know the current value of the variable at the point of the store is > result of ASAN_POISON and be able to instead of turning that > my_char = _23; > into > my_char_35 = _23; > turn it into: > my_char_35 = ASAN_POISON (_23); > which would represent after scope store into my_char. > > Not really familiar with into-ssa though to know where to do it. > > Jakub > Richi, may I ask you for help with this question? Thanks, Martin