On Thu, Nov 13, 2014 at 12:55:40AM -0500, tsaund...@mozilla.com wrote: > From: Trevor Saunders <tsaund...@mozilla.com> > diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c > index b70c56c..227509a 100644 > --- a/gcc/config/i386/i386.c > +++ b/gcc/config/i386/i386.c > @@ -14032,14 +14032,34 @@ legitimize_tls_address (rtx x, enum tls_model > model, bool for_mov) > to symbol DECL if BEIMPORT is true. Otherwise create or return the > unique refptr-DECL symbol corresponding to symbol DECL. */ > > -static GTY((if_marked ("tree_map_marked_p"), param_is (struct tree_map))) > - htab_t dllimport_map; > +struct dllimport_hasher : ggc_cache_hasher<tree_map *> > +{ > + static inline hashval_t hash (tree_map *m) { return m->hash; } > + static inline bool > + equal (tree_map *a, tree_map *b) > + { > + return a->base.from == b->base.from; > + } > + > + static void > + handle_cache_entry (tree_map *&m) > + { > + extern void gt_ggc_mx (tree_map *&); > + if (m == HTAB_EMPTY_ENTRY || m == HTAB_DELETED_ENTRY) > + return; > + else if (ggc_marked_p (m->base.from)) > + gt_ggc_mx (m); > + else > + m = static_cast<tree_map *> (HTAB_DELETED_ENTRY); > + } > +}; > +
Note that the formatting is a bit off here (and in ubsan.c too). Marek