From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58986 invoked by alias); 6 May 2016 14:41:47 -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 58921 invoked by uid 89); 6 May 2016 14:41:46 -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=weekend 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; Fri, 06 May 2016 14:41:45 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id DF2CDAB5D; Fri, 6 May 2016 14:41:41 +0000 (UTC) Subject: Re: [PATCH, RFC] Introduce -fsanitize=use-after-scope To: Jakub Jelinek References: <572C7A3E.4000905@suse.cz> <572C848E.9020705@samsung.com> <572C9963.9020207@suse.cz> <20160506132528.GK26501@tucnak.zalov.cz> Cc: Yury Gribov , GCC Patches From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <572CAD25.2040804@suse.cz> Date: Fri, 06 May 2016 14:41:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <20160506132528.GK26501@tucnak.zalov.cz> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg00504.txt.bz2 On 05/06/2016 03:25 PM, Jakub Jelinek wrote: > Well, we already have the gimple poisoning/unpoisoning code on RTL (emitted > after the prologue and before the epilogue), so it shouldn't be that hard. > I'd only do the most common/easy cases inline though, like 1/2/4/8/16/32 > bytes long variables. > > Jakub You are right, I didn't realize it earlier. As I've collected statistics for tramp3d, poisoning code has following distribution: 4:1.62% 8:3.53% 12:94.76% which is quite interesting that 12B are such a common size :) Probably due to a lot of time spent in ::evaluate (MultiArgEvaluator and MultiArgEvaluator). Considering just variables which needs_to_live_in_memory, tramp3d is still ~15x slower. Anyway profile report tells: 26.51% a.out libasan.so.3.0.0 [.] __asan::PoisonShadow 18.49% a.out libasan.so.3.0.0 [.] PoisonAlignedStackMemory 5.61% a.out libc-2.22.so [.] __memset_avx2 5.41% a.out a.out [.] MultiArgEvaluator::evaluate 3.56% a.out libasan.so.3.0.0 [.] __asan_unpoison_stack_memory 2.69% a.out libasan.so.3.0.0 [.] __asan_poison_stack_memory I'll continue working on that after weekend. Martin