From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101576 invoked by alias); 23 Jan 2017 09:38:19 -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 101561 invoked by uid 89); 23 Jan 2017 09:38:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*MI:sk:4e0e7db, H*f:sk:4e0e7db, H*i:sk:4e0e7db 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; Mon, 23 Jan 2017 09:38:17 +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 3FC8BC057FA5; Mon, 23 Jan 2017 09:38:17 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-250.ams2.redhat.com [10.36.116.250]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0N9cFm1008643 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 23 Jan 2017 04:38:16 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id v0N9cDce022186; Mon, 23 Jan 2017 10:38:13 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v0N9cAdg022185; Mon, 23 Jan 2017 10:38:10 +0100 Date: Mon, 23 Jan 2017 09:39:00 -0000 From: Jakub Jelinek To: Martin =?utf-8?B?TGnFoWth?= Cc: Richard Biener , GCC Patches Subject: Re: [PATCH] Speed-up use-after-scope (re-writing to SSA) (version 2) Message-ID: <20170123093810.GJ1867@tucnak> Reply-To: Jakub Jelinek References: <29d32a7c-a95d-ddb1-d64e-ae8f659d3a4b@suse.cz> <20170116142025.GO1867@tucnak> <7e7f795d-a7a7-584e-8c77-61ea01207c40@suse.cz> <20170117164721.GE1867@tucnak> <20170119163358.GQ1867@tucnak> <5ca02d10-8023-63ea-1669-e5f56f08ec67@suse.cz> <20170120142717.GT1867@tucnak> <4e0e7dbe-e770-bc77-b25f-6f38f5125e89@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4e0e7dbe-e770-bc77-b25f-6f38f5125e89@suse.cz> User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg01731.txt.bz2 On Mon, Jan 23, 2017 at 10:19:33AM +0100, Martin Liška wrote: > diff --git a/gcc/gimplify.c b/gcc/gimplify.c > index 2777a23eb93..1b076fdf45c 100644 > --- a/gcc/gimplify.c > +++ b/gcc/gimplify.c > @@ -1206,8 +1206,19 @@ asan_poison_variables (hash_set *variables, bool poison, gimple_seq *seq_p > > sorted_variables.qsort (sort_by_decl_uid); > > - for (unsigned i = 0; i < sorted_variables.length (); i++) > - asan_poison_variable (sorted_variables[i], poison, seq_p); > + unsigned i; > + tree var; > + FOR_EACH_VEC_ELT (sorted_variables, i, var) > + { > + asan_poison_variable (var, poison, seq_p); > + > + /* Add use_after_scope_memory attribute for the variable in order > + to prevent re-written into SSA. */ > + DECL_ATTRIBUTES (var) > + = tree_cons (get_identifier ("use_after_scope_memory"), Please use "use after scope memory" to make it clear it is internal only attribute users can't specify. Also, can't asan_poison_variables be performed on the same var multiple times (multiple labels, or switches, ...)? If yes, then the addition of the attribute should be guarded with if (!lookup_attribute ("use after scope memory", DECL_ATTRIBUTES (vars))) so that you don't add the attributes many times. > + build_int_cst (integer_type_node, 1), > + DECL_ATTRIBUTES (var)); Please use: integer_one_node, DECL_ATTRIBUTES (var)); instead. > --- a/gcc/tree-ssa.c > +++ b/gcc/tree-ssa.c > @@ -1565,6 +1565,10 @@ is_asan_mark_p (gimple *stmt) > && VAR_P (TREE_OPERAND (addr, 0))) > { > tree var = TREE_OPERAND (addr, 0); > + if (lookup_attribute ("use_after_scope_memory", > + DECL_ATTRIBUTES (var))) > + return false; See above. Patchset is ok for trunk with these nits fixed, thanks. Jakub