[PATCH] Canonical types (1/3)

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Tue Dec 5 20:03:00 GMT 2006

> So, TYPE_NEXT_VARIANT basically contains a mish-mash of types that are
> somehow related to the TYPE_MAIN_VARIANT, but may or may not be
> equivalent.

The issue is what does "somehow related" mean.  In the past, I didn't think
that two types that had different alignments were consider sufficiently
related to have the same TYPE_MAIN_VARIANT.  So it seems wrong to have that
happen now.

> It's also important to note that TYPE_NEXT_VARIANT does not even
> contain all types that are equivalent to the main variant... 

That's because it's not supposed to!  If you think that it is, then I
think you misunderstand something significant and suggests that this part
of your patch is wrong.

TYPE_MAIN_VARIANT is supposed to be a list of type that differ *only* in
certain flags and there is supposed to be exactly *one* type for each 
possible settings of the flags in the chain.

> int* and foo_t* will not occur in the same list of variants. 

And should not!

> They are completely distinct type nodes, but comptypes will make them
> compare equal.

But that has nothing whatsoever to do with variants!

More information about the Gcc-patches mailing list