From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22466 invoked by alias); 29 Jan 2013 15:12:39 -0000 Received: (qmail 22447 invoked by uid 22791); 29 Jan 2013 15:12:39 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 29 Jan 2013 15:12:25 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0TFCOwT016701 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 29 Jan 2013 10:12:25 -0500 Received: from zalov.redhat.com (vpn1-6-76.ams2.redhat.com [10.36.6.76]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r0TFCMT0025110 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 29 Jan 2013 10:12:24 -0500 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.redhat.com (8.14.5/8.14.5) with ESMTP id r0TFCM5o021912; Tue, 29 Jan 2013 16:12:22 +0100 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id r0TFCMSe021911; Tue, 29 Jan 2013 16:12:22 +0100 Date: Tue, 29 Jan 2013 15:12:00 -0000 From: Jakub Jelinek To: Dodji Seketeli Cc: GCC Patches , Kostya Serebryany , Dmitry Vyukov Subject: Re: [PATCH 2/2] [asan] Avoid instrumenting duplicated memory access in the same basic block Message-ID: <20130129151221.GT4385@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <87mwvtxalf.fsf@redhat.com> <87ehh5xabo.fsf@redhat.com> <20130129150022.GS4385@tucnak.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130129150022.GS4385@tucnak.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 X-SW-Source: 2013-01/txt/msg01393.txt.bz2 On Tue, Jan 29, 2013 at 04:00:22PM +0100, Jakub Jelinek wrote: > @@ -1464,23 +1726,39 @@ transform_statements (void) > > FOR_EACH_BB (bb) > { > + get_mem_ref_hash_table ().dispose (); > + > if (bb->index >= saved_last_basic_block) continue; > for (i = gsi_start_bb (bb); !gsi_end_p (i);) > + if (is_gimple_call (s)) > + get_mem_ref_hash_table ().dispose (); > + Two more things. IMHO the hash table should be a global var, not a static inside get_mem_ref_hash_table (), because otherwise all these 3 calls just create an empty hash table and immediately destroy it. And, at BB boundaries and for calls, you shouldn't use .dispose (), but .empty () method. So my preference would be if (asan_mem_ref_ht.is_created ()) asan_mem_ref_ht.empty (); (for the two above occurrences, resp. .dispose () for the one below). + gsi_next (&i); } - gsi_next (&i); } } + get_mem_ref_hash_table ().dispose (); } Jakub