public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Dodji Seketeli <dodji@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Kostya Serebryany <kcc@google.com>,
	       Dmitry Vyukov <dvyukov@google.com>
Subject: Re: [PATCH 2/2] [asan] Avoid instrumenting duplicated memory access in the same basic block
Date: Tue, 29 Jan 2013 15:12:00 -0000	[thread overview]
Message-ID: <20130129151221.GT4385@tucnak.redhat.com> (raw)
In-Reply-To: <20130129150022.GS4385@tucnak.redhat.com>

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

  reply	other threads:[~2013-01-29 15:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-28 21:27 [PATCH 0/2] Avoid duplicated instrumentation in Address Sanitizer Dodji Seketeli
2013-01-28 21:30 ` [PATCH 1/2] [asan] Allow creating/deleting hash table entries with new/delete Dodji Seketeli
2013-01-28 22:08   ` Lawrence Crowl
2013-01-28 21:32 ` [PATCH 2/2] [asan] Avoid instrumenting duplicated memory access in the same basic block Dodji Seketeli
2013-01-29 15:01   ` Jakub Jelinek
2013-01-29 15:12     ` Jakub Jelinek [this message]
2013-02-12 14:20     ` Dodji Seketeli
2013-02-12 14:27       ` Jakub Jelinek
2013-02-12 16:28         ` Dodji Seketeli
2013-02-12 17:03           ` Jakub Jelinek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130129151221.GT4385@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=dodji@redhat.com \
    --cc=dvyukov@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kcc@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).