From patchwork Mon Nov 7 05:55:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: 19/n: trans-mem: middle end/misc patches (LAST PATCH) Date: Sun, 06 Nov 2011 19:55:41 -0000 From: Aldy Hernandez X-Patchwork-Id: 124005 Message-Id: <4EB772DD.7020904@redhat.com> To: Richard Henderson Cc: Richard Guenther , gcc-patches > False. You get the equivalent of bootstrap comparison mismatches. > If we actually used tm during the bootstrap. > > The simplest thing to do is to change the hash this table uses. > E.g. use the DECL_UID right from the start, rather than the pointer. Woah! Can it be that easy? That's as easy as changing the hash, no conversion necessary. OK for branch? * varasm.c (record_tm_clone_pair): Use DECL_UID as hash. (get_tm_clone_pair): Same. Index: varasm.c =================================================================== --- varasm.c (revision 181067) +++ varasm.c (working copy) @@ -5875,7 +5875,7 @@ record_tm_clone_pair (tree o, tree n) tm_clone_pairs = htab_create_ggc (32, tree_map_hash, tree_map_eq, 0); h = ggc_alloc_tree_map (); - h->hash = htab_hash_pointer (o); + h->hash = DECL_UID (o); h->base.from = o; h->to = n; @@ -5892,7 +5892,7 @@ get_tm_clone_pair (tree o) struct tree_map *h, in; in.base.from = o; - in.hash = htab_hash_pointer (o); + in.hash = DECL_UID (o); h = (struct tree_map *) htab_find_with_hash (tm_clone_pairs, &in, in.hash); if (h)