On Nov 9, 2006, at 4:54 PM, Mike Stump wrote:
On Nov 8, 2006, at 7:14 AM, Ian Lance Taylor wrote:
The way to canonicalize them is to have all equivalent types point to
a single canonical type for the equivalence set. The comparison is
one memory dereference and one pointer comparison, not the current
procedure of checking for structural equivalence.
Once not equal addresses might mean equal types, you have to do a
structure walk to compare types, and you're right back were we
started. The only way to save yourself, is to be able to say,
different addresses, _must_ be different types.
I had in mind something like
if (p1 == p2)
equal
else if (p1->ptr_equality_suffices_for_this_type || p2-
>ptr_equality_suffices_for_this_type)
not equal
else
tree walk
Don't know how workable that is.