https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114931
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Do you really need to hash it on TYPE_CANON, rather than just on whether the type is TYPE_STRUCTURAL_EQUALITY_P or not? I'm worried that always computing the TYPE_CANON before calling type_hash_canon is going to be quite expensive, while just figuring out if it should have TYPE_STRUCTURAL_EQUALITY_P or not should be cheaper. If it should have TYPE_STRUCTURAL_EQUALITY_P, we'd SET_TYPE_STRUCTURAL_EQUALITY, otherwise set TYPE_CANONICAL (t) = t; (I think that is what we generally get from make_node), look up and recompute TYPE_CANONICAL if TYPE_CANONICAL (t) == t.