This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ubsan] Fix bootstrap comparison


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  <polacek@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]