From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117355 invoked by alias); 3 Nov 2016 14:04:10 -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 116696 invoked by uid 89); 3 Nov 2016 14:04:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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; Thu, 03 Nov 2016 14:04:04 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 86F5CC05AA4C; Thu, 3 Nov 2016 14:04:03 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-204-19.brq.redhat.com [10.40.204.19]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uA3E41EN014461 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 3 Nov 2016 10:04:03 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id uA3E40gD023711; Thu, 3 Nov 2016 15:04:00 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id uA3E3xih023710; Thu, 3 Nov 2016 15:03:59 +0100 Date: Thu, 03 Nov 2016 14:04:00 -0000 From: Jakub Jelinek To: Martin =?utf-8?B?TGnFoWth?= Cc: Richard Biener , GCC Patches Subject: Re: [PATCH, RFC] Introduce -fsanitize=use-after-scope (v2) Message-ID: <20161103140359.GO3541@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20161102125609.GQ3541@tucnak.redhat.com> <20161102130612.GR3541@tucnak.redhat.com> <685c51a0-07bc-03d5-d988-bbf12dd21143@suse.cz> <20161102145102.GW3541@tucnak.redhat.com> <7a549bb1-e249-233f-b05f-e10a47c0d323@suse.cz> <20161103134438.GK3541@tucnak.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00328.txt.bz2 On Thu, Nov 03, 2016 at 03:02:21PM +0100, Martin Liška wrote: > > But how would you be able to find out if there isn't any return *ptr; after > > the scope or similar (as MEM_REF)? With is_gimple_reg, they will be turned > > into SSA form and you can easily verify (uses of ASAN_POISON are a problem > > if they are encountered at runtime). What would you do for the > > must_live_in_memory vars? Add some pass that detects it, handle it somehow > > in addressable pass, handle it in SRA, ... ? > > If there's return of *ptr, there must be a &my_char, and it looks > _4 = MEM[(char *)&my_char]; > > properly identifies that my_char has address taken. It doesn't. MEM_REF's ADDR_EXPR isn't considered to be address taking. Jakub