> On Thu, 27 Jun 2019, Jan Hubicka wrote: > > > Hi, > > here is update patch I am re-testing. Ok if it suceeds? > > + if (!type_in_anonymous_namespace_p (t)) > + hash = htab_hash_string (IDENTIFIER_POINTER > + (DECL_ASSEMBLER_NAME > + (TYPE_NAME (t)))); > + else > + hash = TYPE_UID (t); > + num_canonical_type_hash_entries++; > + bool existed_p = canonical_type_hash_cache->put (prevail, hash); > > but you still cache the hash for prevail rather than t while we > are eventually asking for the hash of t again? I suppose not since > we just adjusted TYPE_CANONICAL and we're then supposed to pick > the hash from the canonical type? I think this deserves a comment. > And it should use 'prevail' then everywhere here for consistency, > otherwise it really looks odd.
Yes, all ODR variants will get prevail as their TYPE_CANONICAL and therefore we need to cache its hash. I will add comment. > > > @@ -357,7 +367,7 @@ iterative_hash_canonical_type (tree type > > optimal order. To avoid quadratic behavior also register the > > type here. */ > > v = hash_canonical_type (type); > > - gimple_register_canonical_type_1 (type, v); > > + v = gimple_register_canonical_type_1 (type, v); > > } > > hstate.add_int (v); > > } > > Just noticed this should be > > hstate.merge_hash (v); > > results in the very same effect but is clearer IMHO. OK, will fix that too, re-test and commit. Thanks! Honza