On Fri, Aug 23, 2013 at 02:37:56PM +0200, Marek Polacek wrote: > This patch fixes bootstrap comparison when doing bootstrap > with -fsanitize=undefined enabled. We need to hash the UID of the > type and also I had to switch two statements; we need to get > TYPE_MAIN_VARIANT of the type first... > Hence, no more bootstrap comparison failures. Woohoo! > > Tested x86_64-linux, applying to the ubsan branch. > > 2013-08-23 Marek Polacek <pola...@redhat.com> > > * ubsan.c (ubsan_typedesc_hasher::hash): Hash the TYPE_UID of the > type. > (ubsan_type_descriptor): Get TYPE_MAIN_VARIANT before initializing > the type descriptor. > > --- gcc/ubsan.c.mp 2013-08-23 14:28:15.780955545 +0200 > +++ gcc/ubsan.c 2013-08-23 14:28:47.467059363 +0200 > @@ -60,7 +60,7 @@ struct ubsan_typedesc_hasher > inline hashval_t > ubsan_typedesc_hasher::hash (const ubsan_typedesc *data) > { > - return iterative_hash_object (data->type, 0); > + return iterative_hash_object (TYPE_UID (data->type), 0);
Why not just return TYPE_UID (data->type); ? Anyway, once you change the hash table uses into pointer_map, this will all go away. Jakub